Class: Warden::JWTAuth::Strategy
- Inherits:
-
Strategies::Base
- Object
- Strategies::Base
- Warden::JWTAuth::Strategy
- Defined in:
- lib/warden/jwt_auth/strategy.rb
Overview
Warden strategy to authenticate an user through a JWT token in the ‘Authorization` request header :reek:PrimaDonnaMethod
Instance Method Summary collapse
- #authenticate! ⇒ Object
- #store? ⇒ Boolean
-
#valid? ⇒ Boolean
:reek:NilCheck.
Instance Method Details
#authenticate! ⇒ Object
20 21 22 23 24 25 26 |
# File 'lib/warden/jwt_auth/strategy.rb', line 20 def authenticate! aud = EnvHelper.aud_header(env) user = UserDecoder.new.call(token, scope, aud) success!(user) rescue JWT::DecodeError => exception fail!(exception.) end |
#store? ⇒ Boolean
16 17 18 |
# File 'lib/warden/jwt_auth/strategy.rb', line 16 def store? false end |
#valid? ⇒ Boolean
:reek:NilCheck
12 13 14 |
# File 'lib/warden/jwt_auth/strategy.rb', line 12 def valid? !token.nil? end |