Skip to content

Commit d7f87ed

Browse files
authored
Update the default cache period for userinfo (#734)
1 parent bda9b1d commit d7f87ed

File tree

2 files changed

+1
-2
lines changed

2 files changed

+1
-2
lines changed

backend/common/security/jwt.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -294,7 +294,7 @@ async def jwt_authentication(token: str) -> GetUserInfoWithRelationDetail:
294294
user = GetUserInfoWithRelationDetail(**select_as_dict(current_user))
295295
await redis_client.setex(
296296
f'{settings.JWT_USER_REDIS_PREFIX}:{user_id}',
297-
settings.JWT_USER_REDIS_EXPIRE_SECONDS,
297+
settings.TOKEN_EXPIRE_SECONDS,
298298
user.model_dump_json(),
299299
)
300300
else:

backend/core/conf.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,6 @@ class Settings(BaseSettings):
7575

7676
# JWT
7777
JWT_USER_REDIS_PREFIX: str = 'fba:user'
78-
JWT_USER_REDIS_EXPIRE_SECONDS: int = 60 * 60 * 24 * 7 # 7 天
7978

8079
# RBAC
8180
RBAC_ROLE_MENU_MODE: bool = True

0 commit comments

Comments
 (0)