mirror of
https://github.com/langbot-app/LangBot.git
synced 2026-06-14 09:46:03 +00:00
fix(i18n,api): backfill missing token-monitoring keys and fix JWT expiry tz
- i18n: add models.searchProviders, monitoring.tabs.tokens and the monitoring.tokens.* block (incl. bucket.hour/day) to es-ES, ja-JP, ru-RU, th-TH, vi-VN and zh-Hant, which were missing them and failed the Check i18n Keys CI. - api: generate_jwt_token built 'exp' from a naive datetime.now(), which PyJWT validates against UTC — in any timezone ahead of UTC the token was already expired at issue time. Use datetime.now(timezone.utc).
This commit is contained in:
@@ -82,7 +82,7 @@ class UserService:
|
||||
payload = {
|
||||
'user': user_email,
|
||||
'iss': 'LangBot-' + constants.edition,
|
||||
'exp': datetime.datetime.now() + datetime.timedelta(seconds=jwt_expire),
|
||||
'exp': datetime.datetime.now(datetime.timezone.utc) + datetime.timedelta(seconds=jwt_expire),
|
||||
}
|
||||
|
||||
return jwt.encode(payload, jwt_secret, algorithm='HS256')
|
||||
|
||||
Reference in New Issue
Block a user