Class: ExternalIdentity::Manager
- Inherits:
-
Object
- Object
- ExternalIdentity::Manager
- Defined in:
- lib/external_identity/manager.rb
Instance Attribute Summary collapse
-
#env ⇒ Object
Returns the value of attribute env.
Instance Method Summary collapse
- #authenticate! ⇒ Object
- #identity ⇒ Object
-
#initialize(env) ⇒ Manager
constructor
A new instance of Manager.
- #valid? ⇒ Boolean
Constructor Details
#initialize(env) ⇒ Manager
Returns a new instance of Manager.
7 8 9 |
# File 'lib/external_identity/manager.rb', line 7 def initialize(env) @env = env end |
Instance Attribute Details
#env ⇒ Object
Returns the value of attribute env.
5 6 7 |
# File 'lib/external_identity/manager.rb', line 5 def env @env end |
Instance Method Details
#authenticate! ⇒ Object
11 12 13 |
# File 'lib/external_identity/manager.rb', line 11 def authenticate! warden.authenticate!(scope: warden_scope) end |
#identity ⇒ Object
15 16 17 |
# File 'lib/external_identity/manager.rb', line 15 def identity @identity ||= warden.authenticate(scope: warden_scope) end |
#valid? ⇒ Boolean
19 20 21 |
# File 'lib/external_identity/manager.rb', line 19 def valid? !!identity end |