Class: Motion::Authentication
- Inherits:
-
Object
- Object
- Motion::Authentication
- Defined in:
- lib/project/motion-authentication.rb,
lib/project/strategies/devise_token_auth.rb
Defined Under Namespace
Classes: DeviseTokenAuth
Class Attribute Summary collapse
-
.current_user ⇒ Object
Returns the value of attribute current_user.
Class Method Summary collapse
- .authorization_header ⇒ Object
- .sign_in(params, &block) ⇒ Object
- .sign_in_url(val = nil) ⇒ Object
- .sign_out(&block) ⇒ Object
- .signed_in? ⇒ Boolean
- .strategy(val = nil) ⇒ Object
Class Attribute Details
.current_user ⇒ Object
Returns the value of attribute current_user.
4 5 6 |
# File 'lib/project/motion-authentication.rb', line 4 def current_user @current_user end |
Class Method Details
.authorization_header ⇒ Object
20 21 22 |
# File 'lib/project/motion-authentication.rb', line 20 def strategy. end |
.sign_in(params, &block) ⇒ Object
16 17 18 |
# File 'lib/project/motion-authentication.rb', line 16 def sign_in(params, &block) strategy.sign_in(sign_in_url, params, &block) end |
.sign_in_url(val = nil) ⇒ Object
11 12 13 14 |
# File 'lib/project/motion-authentication.rb', line 11 def sign_in_url(val = nil) @sign_in_url = val unless val.nil? @sign_in_url end |
.sign_out(&block) ⇒ Object
28 29 30 |
# File 'lib/project/motion-authentication.rb', line 28 def sign_out(&block) strategy.sign_out(&block) end |
.signed_in? ⇒ Boolean
24 25 26 |
# File 'lib/project/motion-authentication.rb', line 24 def signed_in? strategy.signed_in? end |
.strategy(val = nil) ⇒ Object
6 7 8 9 |
# File 'lib/project/motion-authentication.rb', line 6 def strategy(val = nil) @strategy = val unless val.nil? @strategy ||= DeviseTokenAuth end |