Class: JWT::Claims::Issuer
- Inherits:
-
Object
- Object
- JWT::Claims::Issuer
- Defined in:
- lib/jwt/claims/issuer.rb
Instance Method Summary collapse
-
#initialize(issuers:) ⇒ Issuer
constructor
A new instance of Issuer.
- #verify!(context:, **_args) ⇒ Object
Constructor Details
#initialize(issuers:) ⇒ Issuer
Returns a new instance of Issuer.
6 7 8 |
# File 'lib/jwt/claims/issuer.rb', line 6 def initialize(issuers:) @issuers = Array(issuers).map { |item| item.is_a?(Symbol) ? item.to_s : item } end |
Instance Method Details
#verify!(context:, **_args) ⇒ Object
10 11 12 13 14 15 16 17 |
# File 'lib/jwt/claims/issuer.rb', line 10 def verify!(context:, **_args) case (iss = context.payload['iss']) when *issuers nil else raise JWT::InvalidIssuerError, "Invalid issuer. Expected #{issuers}, received #{iss || '<none>'}" end end |