diff options
author | Parker <contact@pkrm.dev> | 2024-11-04 23:57:29 -0600 |
---|---|---|
committer | Parker <contact@pkrm.dev> | 2024-11-04 23:57:29 -0600 |
commit | c51440e0f54dfbe356f3230f8e9226629b8e41ca (patch) | |
tree | 6395587b6b44ff90fea44f5cde79f8cab890e593 /app/routes/token_route.py | |
parent | e9d877c0ad4c1e2516a0ae64edb937ec64a42fdd (diff) |
User routes + some updates
Diffstat (limited to 'app/routes/token_route.py')
-rw-r--r-- | app/routes/token_route.py | 20 |
1 files changed, 13 insertions, 7 deletions
diff --git a/app/routes/token_route.py b/app/routes/token_route.py index 8000616..124e0cc 100644 --- a/app/routes/token_route.py +++ b/app/routes/token_route.py @@ -44,11 +44,17 @@ async def login_for_access_token( data={"sub": user.username, "refresh": True}, expires_delta=refresh_token_expires, ) - response = JSONResponse(content={"success": True}) - response.set_cookie( - key="access_token", value=access_token, httponly=True, samesite="lax" - ) - response.set_cookie( - key="refresh_token", value=refresh_token, httponly=True, samesite="lax" + # response = JSONResponse(content={"success": True}) + # response.set_cookie( + # key="access_token", value=access_token, httponly=True, samesite="lax" + # ) + # response.set_cookie( + # key="refresh_token", value=refresh_token, httponly=True, samesite="lax" + # ) + + # For Swagger UI to work, must return the token + return Token( + access_token=access_token, + refresh_token=refresh_token, + token_type="bearer", ) - return response |