Skip to content

Commit a0eeff1

Browse files
committed
Use exp key for JWT as well as expiry key
1 parent e5f8adc commit a0eeff1

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

backend/routes/auth/authorize.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,10 @@ async def process_token(
5454
"refresh": bearer_token["refresh_token"],
5555
"user_details": user_details,
5656
"in_guild": bool(member),
57+
# Legacy key, we should use exp and use JWT expiry as below it.
5758
"expiry": token_expiry.isoformat(),
59+
# Correct JWT expiry key:
60+
"exp": token_expiry
5861
}
5962

6063
token = jwt.encode(data, SECRET_KEY, algorithm="HS256")

0 commit comments

Comments
 (0)