Module: RailsJwtAuth::WardenHelper
- Defined in:
- app/helpers/rails_jwt_auth/warden_helper.rb
Instance Method Summary collapse
- #authenticate! ⇒ Object
- #current_user ⇒ Object
- #render_401 ⇒ Object
- #signed_in? ⇒ Boolean
- #warden ⇒ Object
Instance Method Details
#authenticate! ⇒ Object
15 16 17 |
# File 'app/helpers/rails_jwt_auth/warden_helper.rb', line 15 def authenticate! warden.authenticate! end |
#current_user ⇒ Object
7 8 9 |
# File 'app/helpers/rails_jwt_auth/warden_helper.rb', line 7 def current_user warden.user end |
#render_401 ⇒ Object
19 20 21 |
# File 'app/helpers/rails_jwt_auth/warden_helper.rb', line 19 def render_401 render json: {}, status: 401 end |
#signed_in? ⇒ Boolean
3 4 5 |
# File 'app/helpers/rails_jwt_auth/warden_helper.rb', line 3 def signed_in? !current_user.nil? end |
#warden ⇒ Object
11 12 13 |
# File 'app/helpers/rails_jwt_auth/warden_helper.rb', line 11 def warden request.env['warden'] end |