```
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:
parent
a7b114725a
commit
5a77c36a95
2 changed files with 0 additions and 2 deletions
|
|
@ -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)
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue