Update code in endpoints/logouts.post.py
This commit is contained in:
parent
ce235fb8fc
commit
958bc8eecc
16
endpoints/logouts.post.py
Normal file
16
endpoints/logouts.post.py
Normal file
@ -0,0 +1,16 @@
|
||||
from fastapi import APIRouter, Depends, HTTPException, status
|
||||
from sqlalchemy.orm import Session
|
||||
from core.database import get_db
|
||||
from models.user import User
|
||||
from schemas.user import UserSchema
|
||||
from helpers.auth_helpers import logout_user
|
||||
|
||||
router = APIRouter()
|
||||
|
||||
@router.post("/logouts", status_code=200)
|
||||
async def logout(
|
||||
db: Session = Depends(get_db)
|
||||
):
|
||||
"""Logout user"""
|
||||
logout_user(db)
|
||||
return {"message": "Successfully logged out"}
|
Loading…
x
Reference in New Issue
Block a user