Class: Rack::BackDoor
- Inherits:
-
Object
- Object
- Rack::BackDoor
- Defined in:
- lib/rack/back_door.rb
Overview
Force a User to be authenticated ala robots.thoughtbot.com/post/37907699673/faster-tests-sign-in-through-the-back-door
Defined Under Namespace
Classes: Configuration
Class Attribute Summary collapse
-
.configuration ⇒ Object
Returns the value of attribute configuration.
Class Method Summary collapse
Instance Method Summary collapse
- #call(env) ⇒ Object
-
#initialize(app) ⇒ BackDoor
constructor
A new instance of BackDoor.
Constructor Details
#initialize(app) ⇒ BackDoor
Returns a new instance of BackDoor.
35 36 37 |
# File 'lib/rack/back_door.rb', line 35 def initialize(app) @app = app end |
Class Attribute Details
.configuration ⇒ Object
Returns the value of attribute configuration.
7 8 9 |
# File 'lib/rack/back_door.rb', line 7 def configuration @configuration end |
Class Method Details
.configure {|configuration| ... } ⇒ Object
9 10 11 |
# File 'lib/rack/back_door.rb', line 9 def configure yield configuration if block_given? end |
.session_key ⇒ Object
21 22 23 |
# File 'lib/rack/back_door.rb', line 21 def session_key configuration.session_key end |
.url_parameter ⇒ Object
17 18 19 |
# File 'lib/rack/back_door.rb', line 17 def url_parameter configuration.url_parameter end |
Instance Method Details
#call(env) ⇒ Object
39 40 41 42 43 |
# File 'lib/rack/back_door.rb', line 39 def call(env) @env = env sign_in_through_the_back_door @app.call(@env) end |