class Devise::JWT::Cookie::Strategy

Warden strategy to authenticate an user through a JWT token in an http-only cookie

Public Instance Methods

authenticate!() click to toggle source
# File lib/devise/jwt/cookie/strategy.rb, line 17
def authenticate!
  # FIXME support aud
  aud = nil
  user = Warden::JWTAuth::UserDecoder.new.call(token, scope, aud)
  success!(user)
rescue ::JWT::DecodeError => exception
  fail!(exception.message)
end
store?() click to toggle source
# File lib/devise/jwt/cookie/strategy.rb, line 13
def store?
  false
end
valid?() click to toggle source
# File lib/devise/jwt/cookie/strategy.rb, line 9
def valid?
  !token.nil?
end

Private Instance Methods

token() click to toggle source
# File lib/devise/jwt/cookie/strategy.rb, line 28
def token
  @token ||= CookieHelper.new.read_from(cookies)
end