-
-
Notifications
You must be signed in to change notification settings - Fork 464
Open
Labels
bugSomething isn't workingSomething isn't working
Description
Describe the bug
When using the oauth_router
, the state
jwt token has an expiration time.
When the callback tries to call the callback
endpoint with an expired state token, an Internal Server Error (500) is thrown because the jwt.ExpiredSignatureError
is thrown, however only the jwt.DecodeError
case is handled in the code.
To Reproduce
- Call the
oauth_routers
/authorize
endpoint. - Wait for the
state
token to expire. - Call the
/callback
with an otherwise valid request (except for an expired token). - See error
Expected behavior
When calling the callback
endpoint with an Invalid token:
400 BAD REQUEST
or similar, should be the response instead of 500
Solution Proposal
Catch jwt.InvalidTokenError
instead of just jwt.DecodeError
.
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working