File tree Expand file tree Collapse file tree 1 file changed +3
-8
lines changed
Expand file tree Collapse file tree 1 file changed +3
-8
lines changed Original file line number Diff line number Diff line change @@ -81,11 +81,8 @@ async def _validate_tokens(self, expiration_only: bool = False) -> bool:
8181
8282 # validate nonce
8383 try :
84- if (
85- hasattr (self , "_nonce" )
86- and id_claims .get ("nonce" )
87- and id_claims .get ("nonce" ) != self ._nonce
88- ):
84+ nonce_claim = id_claims .get ("nonce" )
85+ if (self ._nonce and nonce_claim ) and nonce_claim != self ._nonce :
8986 print ("Nonce mismatch" ) # noqa: T201
9087 return False
9188 except Exception :
@@ -95,9 +92,7 @@ async def _validate_tokens(self, expiration_only: bool = False) -> bool:
9592 try :
9693 at_hash_claim = id_claims .get ("at_hash" )
9794 if (
98- at_hash_claim
99- and hasattr (self , "_expected_at_hash" )
100- and self ._expected_at_hash
95+ self ._expected_at_hash and at_hash_claim
10196 ) and at_hash_claim != self ._expected_at_hash :
10297 print ("at_hash mismatch" ) # noqa: T201
10398 return False
You can’t perform that action at this time.
0 commit comments