Module: RapidApi::Auth::Concerns::AuthenticatedController::AuthenticationHelpers

Defined in:
lib/rapid_api/auth/concerns/authenticated_controller.rb

Instance Method Summary collapse

Instance Method Details

#decode_jwt_token!(token) ⇒ Object



38
39
40
41
42
43
44
45
46
# File 'lib/rapid_api/auth/concerns/authenticated_controller.rb', line 38

def decode_jwt_token!(token)
  begin
    jwt_decode(token)
  rescue JWT::ExpiredSignature
    not_authenticated!
  rescue JWT::VerificationError, JWT::DecodeError
    not_authenticated!
  end
end