Skip to content

Commit 8ee78b1

Browse files
committed
fix access token decoding
1 parent dc7044d commit 8ee78b1

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

app/models.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,8 @@ def generate_token(self, user_id):
6161
def decode_token(token):
6262
"""Decode the access token from the Authorization header."""
6363
try:
64-
payload = jwt.decode(token, current_app.config.get('SECRET'))
64+
payload = jwt.decode(token, current_app.config.get(
65+
'SECRET'), algorithms=["HS256"])
6566
return payload['sub']
6667
except jwt.ExpiredSignatureError:
6768
return "Expired token. Please log in to get a new token"

0 commit comments

Comments
 (0)