Return both refresh & access token expiry
This commit is contained in:
parent
aee0bdd8cf
commit
fd3e355bfc
|
@ -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),
|
||||
)
|
||||
|
||||
|
|
Loading…
Reference in a new issue