Skip to content

Commit 29c6fe0

Browse files
committed
THrow Exception when token is invalid but not expired.
1 parent 55bd29e commit 29c6fe0

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

authress/api/token_verifier.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,9 +55,11 @@ def verify_token(self, authressCustomDomain, token, options=None):
5555

5656
try:
5757
return jwt.decode(authenticationToken, jwt.api_jwk.PyJWK.from_dict(jwk).key, algorithms=['EdDSA'], options = { 'verify_aud': False })
58-
except jwt.ExpiredSignatureError:
58+
except
5959
raise Exception("Unauthorized", "Token is invalid")
6060

61+
raise Exception("Unauthorized", "Token is invalid")
62+
6163
def get_public_key(self, jwkKeyListUrl, kid):
6264
hashKey = f"{jwkKeyListUrl}|{kid}"
6365

0 commit comments

Comments
 (0)