Skip to content

Commit

Permalink
fixed saved user usage
Browse files Browse the repository at this point in the history
  • Loading branch information
ychebyshev committed Mar 21, 2024
1 parent a4ce6c5 commit 1e899ae
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions shvatka/api/routes/auth.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,8 @@ async def tg_login_result(
config: Annotated[AuthConfig, Depends()],
):
check_tg_hash(user, config.bot_token)
await upsert_user(user.to_dto(), dao.user)
token = auth_properties.create_user_token(user.to_dto())
saved = await upsert_user(user.to_dto(), dao.user)
token = auth_properties.create_user_token(saved)
set_auth_response(config, response, token)
return {"ok": True}

Expand All @@ -84,8 +84,8 @@ async def tg_login_result_post(
config: Annotated[AuthConfig, Depends()],
):
check_tg_hash(user, config.bot_token)
await upsert_user(user.to_dto(), dao.user)
token = auth_properties.create_user_token(user.to_dto())
saved = await upsert_user(user.to_dto(), dao.user)
token = auth_properties.create_user_token(saved)
set_auth_response(config, response, token)
return {"ok": True}

Expand Down

0 comments on commit 1e899ae

Please sign in to comment.