Module: Applicaster::AuthHelpers
- Defined in:
- lib/applicaster/auth_helpers.rb
Instance Method Summary collapse
- #authenticate_user! ⇒ Object
- #current_access_token ⇒ Object
- #current_user ⇒ Object
- #user_signed_in? ⇒ Boolean
Instance Method Details
#authenticate_user! ⇒ Object
11 12 13 14 15 16 17 |
# File 'lib/applicaster/auth_helpers.rb', line 11 def authenticate_user! unless current_user store_location! redirect_to '/auth/applicaster' end end |
#current_access_token ⇒ Object
19 20 21 22 23 |
# File 'lib/applicaster/auth_helpers.rb', line 19 def current_access_token if credentials = session[:omniauth_credentials] credentials[:token] || credentials["token"] end end |
#current_user ⇒ Object
3 4 5 |
# File 'lib/applicaster/auth_helpers.rb', line 3 def current_user @current_user ||= user_from_session end |
#user_signed_in? ⇒ Boolean
7 8 9 |
# File 'lib/applicaster/auth_helpers.rb', line 7 def user_signed_in? !current_user.nil? end |