Skip to content

Commit

Permalink
fix: refresh-token bug.
Browse files Browse the repository at this point in the history
  • Loading branch information
EstrellaXD committed Sep 6, 2023
1 parent a430258 commit 52b9dac
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion backend/src/module/api/auth.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ async def login(response: Response, form_data=Depends(OAuth2PasswordRequestForm)
@router.get("/refresh_token", response_model=dict, dependencies=[Depends(get_current_user)])
async def refresh(response: Response):
token = create_access_token(
data={"sub": get_current_user}, expires_delta=timedelta(days=1)
data={"sub": get_current_user()}, expires_delta=timedelta(days=1)
)
response.set_cookie(key="token", value=token, httponly=True, max_age=86400)
return {"access_token": token, "token_type": "bearer"}
Expand Down

0 comments on commit 52b9dac

Please sign in to comment.