class Warden::JWTAuth::TokenRevoker

Revokes a JWT using configured revocation strategy

Public Instance Methods

call(token) click to toggle source

Revokes the JWT token

@param token [String] a JWT

# File lib/warden/jwt_auth/token_revoker.rb, line 12
def call(token)
  payload = TokenDecoder.new.call(token)
  scope = payload['scp'].to_sym
  user = PayloadUserHelper.find_user(payload)
  revocation_strategies[scope].revoke_jwt(payload, user)
# rubocop:disable Lint/HandleExceptions
rescue JWT::ExpiredSignature
end