Sha256: 1d3ce45f38a89fe92e1337e7c66f108e5c75ce805e16eaf1c9357ad1f133a2a5

Contents?: true

Size: 1.16 KB

Versions: 16

Compression:

Stored size: 1.16 KB

Contents

module Stytch
  class JWTInvalidIssuerError < StandardError
    def initialize(msg = 'JWT issuer did not match')
      super
    end
  end

  class JWTInvalidAudienceError < StandardError
    def initialize(msg = 'JWT audience did not match')
      super
    end
  end

  class JWTExpiredSignatureError < StandardError
    def initialize(msg = 'JWT signature has expired')
      super
    end
  end

  class JWTIncorrectAlgorithmError < StandardError
    def initialize(msg = 'JWT algorithm is incorrect')
      super
    end
  end

  class JWTExpiredError < StandardError
    def initialize(msg = 'JWT has expired')
      super
    end
  end

  class TokenMissingScopeError < StandardError
    def initialize(scope)
      msg = "Missing required scope #{scope}"
      super(msg)
    end
  end

  class TenancyError < StandardError
    def initialize(subject_org_id, request_org_id)
      msg = "Subject organization_id #{subject_org_id} does not match authZ request organization_id #{request_org_id}"
      super(msg)
    end
  end

  class PermissionError < StandardError
    def initialize(request)
      msg = "Permission denied for request #{request}"
      super(msg)
    end
  end
end

Version data entries

16 entries across 16 versions & 1 rubygems

Version Path
stytch-9.0.0 lib/stytch/errors.rb
stytch-8.0.0 lib/stytch/errors.rb
stytch-7.8.1 lib/stytch/errors.rb
stytch-7.8.0 lib/stytch/errors.rb
stytch-7.7.0 lib/stytch/errors.rb
stytch-7.6.0 lib/stytch/errors.rb
stytch-7.5.1 lib/stytch/errors.rb
stytch-7.5.0 lib/stytch/errors.rb
stytch-7.4.0 lib/stytch/errors.rb
stytch-7.3.0 lib/stytch/errors.rb
stytch-7.2.0 lib/stytch/errors.rb
stytch-7.1.0 lib/stytch/errors.rb
stytch-7.0.3 lib/stytch/errors.rb
stytch-7.0.2 lib/stytch/errors.rb
stytch-7.0.1 lib/stytch/errors.rb
stytch-7.0.0 lib/stytch/errors.rb