mirror of
https://github.com/sassanix/Warracker.git
synced 2026-01-05 21:19:42 -06:00
Support PyJWT 2.10
The payload 'sub' must now be a string.
This commit is contained in:
@@ -16,7 +16,7 @@ def generate_token(user_id):
|
||||
payload = {
|
||||
'exp': datetime.utcnow() + current_app.config['JWT_EXPIRATION_DELTA'],
|
||||
'iat': datetime.utcnow(),
|
||||
'sub': user_id
|
||||
'sub': str(user_id)
|
||||
}
|
||||
return jwt.encode(payload, current_app.config['SECRET_KEY'], algorithm='HS256')
|
||||
|
||||
|
||||
Reference in New Issue
Block a user