module RapidApi::Auth::Concerns::AuthenticatedController

Public Instance Methods

authorize!() click to toggle source
# File lib/rapid_api/auth/concerns/authenticated_controller.rb, line 15
def authorize!
  self.authorized = _authorize
  not_authorized! if authorized.nil?
end

Protected Instance Methods

decode_jwt_token!(token) click to toggle source
# File lib/rapid_api/auth/concerns/authenticated_controller.rb, line 22
def decode_jwt_token!(token)
  begin
    jwt_decode(token)
  rescue JWT::ExpiredSignature
    not_authorized!
  rescue JWT::VerificationError, JWT::DecodeError
    not_authorized!
  end
end