Skip to content

Commit

Permalink
Removes error message for malformed JWT tokens
Browse files Browse the repository at this point in the history
  • Loading branch information
kevgliss committed Aug 16, 2023
1 parent b7f84bc commit b1942a4
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/dispatch/plugins/dispatch_core/plugin.py
Expand Up @@ -72,9 +72,10 @@ def get_current_user(self, request: Request, **kwargs):

try:
data = jwt.decode(token, DISPATCH_JWT_SECRET)
except (JWKError, JWTError) as e:
except (JWKError, JWTError):
raise HTTPException(
status_code=HTTP_401_UNAUTHORIZED, detail=[{"msg": str(e)}]
status_code=HTTP_401_UNAUTHORIZED,
detail=[{"msg": "Could not validate credentials"}],
) from None
return data["email"]

Expand Down

0 comments on commit b1942a4

Please sign in to comment.