refactor(auth): remove redundant comments from JWT strategy configurationRemove duplicate comments that were explaining the JWT lifetime configuration
in both API and client authentication backends. The code remains functionallyunchanged but comments are cleaned up for better maintainability.
```
This commit is contained in:
maozhen 2025-12-29 14:17:30 +08:00
parent 130fec5037
commit ca7518ee67
2 changed files with 0 additions and 2 deletions

View file

@ -16,7 +16,6 @@ def get_api_auth_backend():
def get_jwt_strategy() -> JWTStrategy[models.UP, models.ID]:
secret = os.getenv("FASTAPI_USERS_JWT_SECRET", "super_secret")
# 使用环境变量配置过期时间,默认与 client_auth_backend 保持一致3600秒
lifetime_seconds = int(os.getenv("JWT_LIFETIME_SECONDS", "3600"))
return APIJWTStrategy(secret, lifetime_seconds=lifetime_seconds)

View file

@ -18,7 +18,6 @@ def get_client_auth_backend():
from .default.default_jwt_strategy import DefaultJWTStrategy
secret = os.getenv("FASTAPI_USERS_JWT_SECRET", "super_secret")
# 使用环境变量配置过期时间,默认 3600 秒1小时
lifetime_seconds = int(os.getenv("JWT_LIFETIME_SECONDS", "3600"))
return DefaultJWTStrategy(secret, lifetime_seconds=lifetime_seconds)