class Warden::JWTAuth::Strategy

Warden strategy to authenticate an user through a JWT token in the `Authorization` request header :reek: PrimaDonnaMethod

Public Instance Methods

authenticate!() click to toggle source
# 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.message)
end
store?() click to toggle source
# File lib/warden/jwt_auth/strategy.rb, line 16
def store?
  false
end
valid?() click to toggle source

:reek: NilCheck

# File lib/warden/jwt_auth/strategy.rb, line 12
def valid?
  !token.nil?
end

Private Instance Methods

token() click to toggle source
# File lib/warden/jwt_auth/strategy.rb, line 30
def token
  @token ||= HeaderParser.from_env(env)
end