Sha256: ac0fbbada2dac161bde3a415ec122d73c90db763df7a010d8e487fa5c1efdfc5
Contents?: true
Size: 1.25 KB
Versions: 2
Compression:
Stored size: 1.25 KB
Contents
# frozen_string_literal: true # Add here our custom exceptions module JwtAuthenticable module Exceptions # Exception for invalid auth schemes. E.g. users trying to authenticate with basic auth class InvalidAuthScheme < StandardError def message 'Invalid authentication scheme. Only Bearer is supported' end end # Exception when the includer is not invalid class InvalidIncluder < StandardError def message "The includer should export the 'request' method (i.e., it should be a rails controller)" end end # Exception for missing Authentication header class MissingAuth < StandardError def message 'Authentication header must be present' end end # Exception for missing scopes on the JWT class MissingAuthScope < StandardError def initialize(scope) @scope = scope super(scope) end def message "Auth token must contain the #{@scope} scope" end end # Generic exception during the authorization process class AuthorizationError < StandardError def initialize(msg = nil) @msg = msg super(msg) end def message "Authorization error: #{@msg}" end end end end
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
researchable_jwt-authenticable-1.0.1 | lib/jwt_authenticable/exceptions.rb |
researchable_jwt-authenticable-1.0.0 | lib/jwt_authenticable/exceptions.rb |