Module: JwtClaims::Claim::Sub

Defined in:
lib/jwt_claims/claim/sub.rb

Overview

Subject

Class Method Summary collapse

Class Method Details

.reject?(sub, options = {}) ⇒ true, false

Returns whether to reject the claim.

Parameters:

  • sub (String)

    the principal that is the subject of the JWT

  • options (Hash) (defaults to: {})

    (key sub:) expected subject to match with claim

Returns:

  • (true, false)

    whether to reject the claim



14
15
16
17
# File 'lib/jwt_claims/claim/sub.rb', line 14

def reject?(sub, options = {})
  expected_subject = options.fetch(:sub, nil)
  !StringOrUri.present_and_equal?(sub, expected_subject)
end