mirror of
https://github.com/fastapi-users/fastapi-users.git
synced 2025-08-14 18:58:10 +08:00
Allow lifetime_seconds to be None to get session cookies
This commit is contained in:
@ -19,7 +19,7 @@ def generate_state_token(
|
||||
data: Dict[str, str], secret: str, lifetime_seconds: int = 3600
|
||||
) -> str:
|
||||
data["aud"] = STATE_TOKEN_AUDIENCE
|
||||
return generate_jwt(data, lifetime_seconds, secret, JWT_ALGORITHM)
|
||||
return generate_jwt(data, secret, lifetime_seconds, JWT_ALGORITHM)
|
||||
|
||||
|
||||
def decode_state_token(token: str, secret: str) -> Dict[str, str]:
|
||||
|
@ -33,8 +33,8 @@ def get_reset_password_router(
|
||||
token_data = {"user_id": str(user.id), "aud": RESET_PASSWORD_TOKEN_AUDIENCE}
|
||||
token = generate_jwt(
|
||||
token_data,
|
||||
reset_password_token_lifetime_seconds,
|
||||
reset_password_token_secret,
|
||||
reset_password_token_lifetime_seconds,
|
||||
)
|
||||
if after_forgot_password:
|
||||
await run_handler(after_forgot_password, user, token, request)
|
||||
|
@ -49,8 +49,8 @@ def get_verify_router(
|
||||
}
|
||||
token = generate_jwt(
|
||||
token_data,
|
||||
verification_token_lifetime_seconds,
|
||||
verification_token_secret,
|
||||
verification_token_lifetime_seconds,
|
||||
)
|
||||
|
||||
if after_verification_request:
|
||||
|
Reference in New Issue
Block a user