Update code in endpoints/logout.post.py
This commit is contained in:
parent
0d81bb6f35
commit
991d776382
@ -9,11 +9,10 @@ async def logout_handler(
|
||||
db: Session = Depends(get_db)
|
||||
):
|
||||
"""Demo logout endpoint"""
|
||||
user = get_user_from_token(token, db)
|
||||
user = get_user_by_token(token, db)
|
||||
if not user:
|
||||
raise HTTPException(status_code=401, detail="Invalid authentication credentials")
|
||||
|
||||
# Invalidate token or perform logout logic here
|
||||
fake_users_db[user["username"]]["disabled"] = True
|
||||
|
||||
return {
|
||||
|
Loading…
x
Reference in New Issue
Block a user