Skip to content

Commit

Permalink
Raise InvalidClaimError for None value
Browse files Browse the repository at this point in the history
  • Loading branch information
lepture committed Apr 6, 2022
1 parent 436e3f9 commit 45ceb49
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions authlib/jose/rfc7519/claims.py
Expand Up @@ -53,8 +53,11 @@ def __getattr__(self, key):

def _validate_essential_claims(self):
for k in self.options:
if self.options[k].get('essential') and not self.get(k):
raise MissingClaimError(k)
if self.options[k].get('essential'):
if k not in self:
raise MissingClaimError(k)
elif not self.get(k):
raise InvalidClaimError(k)

def _validate_claim_value(self, claim_name):
option = self.options.get(claim_name)
Expand Down

0 comments on commit 45ceb49

Please sign in to comment.