Return both refresh & access token expiry

This commit is contained in:
Peter Vacho 2024-12-23 18:28:49 +01:00
parent aee0bdd8cf
commit fd3e355bfc
Signed by: school
GPG key ID: 8CFC3837052871B4

View file

@ -31,6 +31,7 @@ class RefreshTokenResponse(AccessTokenResponseBase):
"""Stores the JWT refresh token data sent in a response."""
refresh_token: str
refresh_token_expires_in: int
@router.post(
@ -65,8 +66,9 @@ async def login(form_data: Annotated[OAuth2PasswordRequestForm, Depends()]) -> R
return RefreshTokenResponse(
refresh_token=refresh_token,
refresh_token_expires_in=REFRESH_TOKEN_EXPIRATION,
access_token=access_token,
expires_in=REFRESH_TOKEN_EXPIRATION,
expires_in=ACCESS_TOKEN_EXPIRATION,
user_id=str(user.id),
)