Add logout functionality to login API
This commit is contained in:
parent
c7435c0c49
commit
3d4200fc82
1 changed files with 7 additions and 0 deletions
|
|
@ -71,3 +71,10 @@ async def refresh_token(response: Response, token: str):
|
|||
detail="Invalid refresh token",
|
||||
headers={"WWW-Authenticate": "Bearer"},
|
||||
)
|
||||
|
||||
|
||||
@router.post("/logout")
|
||||
async def logout(response: Response):
|
||||
response.delete_cookie("refresh_token_lf")
|
||||
response.delete_cookie("access_token_lf")
|
||||
return {"message": "Logout successful"}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue