Class: Rodauth::Rails::App
- Inherits:
-
Roda
- Object
- Roda
- Rodauth::Rails::App
show all
- Defined in:
- lib/rodauth/rails/app.rb,
lib/rodauth/rails/app/flash.rb,
lib/rodauth/rails/app/middleware.rb
Overview
The superclass for creating a Rodauth middleware.
Defined Under Namespace
Modules: Flash, Middleware
Class Method Summary
collapse
Instance Method Summary
collapse
Class Method Details
19
20
21
22
23
24
25
26
27
28
|
# File 'lib/rodauth/rails/app.rb', line 19
def self.configure(*args, **options, &block)
auth_class = args.shift if args[0].is_a?(Class)
name = args.shift if args[0].is_a?(Symbol)
fail ArgumentError, "need to pass optional Rodauth::Auth subclass and optional configuration name" if args.any?
auth_class ||= Class.new(Rodauth::Rails::Auth)
plugin :rodauth, auth_class: auth_class, name: name, csrf: false, flash: false, json: true, **options, &block
end
|
.rodauth!(name) ⇒ Object
44
45
46
|
# File 'lib/rodauth/rails/app.rb', line 44
def self.rodauth!(name)
rodauth(name) or fail ArgumentError, "unknown rodauth configuration: #{name.inspect}"
end
|
Instance Method Details
#rails_request ⇒ Object
40
41
42
|
# File 'lib/rodauth/rails/app.rb', line 40
def rails_request
ActionDispatch::Request.new(env)
end
|
#rails_routes ⇒ Object
36
37
38
|
# File 'lib/rodauth/rails/app.rb', line 36
def rails_routes
::Rails.application.routes.url_helpers
end
|