Class: Trestle::Auth::Backends::Base
- Inherits:
-
Object
- Object
- Trestle::Auth::Backends::Base
- Defined in:
- lib/trestle/auth/backends/base.rb
Instance Attribute Summary collapse
-
#controller ⇒ Object
readonly
Returns the value of attribute controller.
-
#cookies ⇒ Object
readonly
Returns the value of attribute cookies.
-
#request ⇒ Object
readonly
Returns the value of attribute request.
-
#session ⇒ Object
readonly
Returns the value of attribute session.
Instance Method Summary collapse
-
#initialize(controller:, request:, session:, cookies:) ⇒ Base
constructor
A new instance of Base.
-
#previous_location ⇒ Object
Returns (and deletes) the previously stored return location from the session.
-
#scope ⇒ Object
Default params scope to use for the login form.
-
#store_location(url) ⇒ Object
Stores the previous return location in the session to return to after logging in.
Constructor Details
#initialize(controller:, request:, session:, cookies:) ⇒ Base
Returns a new instance of Base.
7 8 9 |
# File 'lib/trestle/auth/backends/base.rb', line 7 def initialize(controller:, request:, session:, cookies:) @controller, @request, @session, @cookies = controller, request, session, end |
Instance Attribute Details
#controller ⇒ Object (readonly)
Returns the value of attribute controller.
5 6 7 |
# File 'lib/trestle/auth/backends/base.rb', line 5 def controller @controller end |
#cookies ⇒ Object (readonly)
Returns the value of attribute cookies.
5 6 7 |
# File 'lib/trestle/auth/backends/base.rb', line 5 def @cookies end |
#request ⇒ Object (readonly)
Returns the value of attribute request.
5 6 7 |
# File 'lib/trestle/auth/backends/base.rb', line 5 def request @request end |
#session ⇒ Object (readonly)
Returns the value of attribute session.
5 6 7 |
# File 'lib/trestle/auth/backends/base.rb', line 5 def session @session end |
Instance Method Details
#previous_location ⇒ Object
Returns (and deletes) the previously stored return location from the session.
22 23 24 |
# File 'lib/trestle/auth/backends/base.rb', line 22 def previous_location session.delete(:trestle_return_to) end |
#scope ⇒ Object
Default params scope to use for the login form.
12 13 14 |
# File 'lib/trestle/auth/backends/base.rb', line 12 def scope :user end |
#store_location(url) ⇒ Object
Stores the previous return location in the session to return to after logging in.
17 18 19 |
# File 'lib/trestle/auth/backends/base.rb', line 17 def store_location(url) session[:trestle_return_to] = url end |