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:NeelCheck.
Instance Method Details
#authenticate! ⇒ Object
20 21 22 23 24 25 |
# File 'lib/warden/jwt_auth/strategy.rb', line 20 def authenticate! user = UserDecoder.new.call(token, scope) success!(user) rescue JWT::DecodeError => e fail!(e.) end |
#store? ⇒ Boolean
16 17 18 |
# File 'lib/warden/jwt_auth/strategy.rb', line 16 def store? false end |
#valid? ⇒ Boolean
:reek:NeelCheck
12 13 14 |
# File 'lib/warden/jwt_auth/strategy.rb', line 12 def valid? !token.nil? end |