Module: Passportist::Helpers
- Extended by:
- ActiveSupport::Concern
- Defined in:
- lib/passportist/helpers.rb
Instance Method Summary collapse
Instance Method Details
#authenticate! ⇒ Object
19 20 21 |
# File 'lib/passportist/helpers.rb', line 19 def authenticate! redirect_to welcome_url unless logged_in? end |
#current_user ⇒ Object
9 10 11 12 13 |
# File 'lib/passportist/helpers.rb', line 9 def current_user @current_user ||= User.find_by_token!([:auth_token]) if [:auth_token] rescue ActiveRecord::RecordNotFound .delete(:auth_token); nil end |
#logged_in? ⇒ Boolean
15 16 17 |
# File 'lib/passportist/helpers.rb', line 15 def logged_in? !! current_user end |