-
Notifications
You must be signed in to change notification settings - Fork 166
Open
Description
During use, I noticed that Refresh and Access tokens do not get into the Redis database
try to connect and see what data is in the redis database
During authorization, after using the get_valid_tokens function, we get an empty set().
And that's why writing to redis doesn't happen
valid_access_tokens = await get_valid_tokens(redis_client, user.id, TokenType.ACCESS)
if valid_access_tokens:
await add_token_to_redis(
redis_client,
user,
access_token,
TokenType.ACCESS,
settings.ACCESS_TOKEN_EXPIRE_MINUTES,
)
I don't understand why the function is called get_refresh_token if we get a new access token at the end.
It would be logical to update the refresh token together too.
@router.post(
"/refresh-token",
response_model=IPostResponseBase[TokenRead],
status_code=201,
)
async def get_refresh_token(
body: RefreshToken = Body(...),
redis_client: Redis = Depends(get_redis_client),
) -> Any:
"""
Gets a refresh token
"""
Metadata
Metadata
Assignees
Labels
No labels