feat(chalice): logout endpoint
This commit is contained in:
parent
912ff486e0
commit
e32865e1bf
1 changed files with 7 additions and 1 deletions
|
|
@ -1,7 +1,7 @@
|
|||
from typing import Union
|
||||
|
||||
from decouple import config
|
||||
from fastapi import Depends, Body, HTTPException
|
||||
from fastapi import Depends, Body, HTTPException, Response
|
||||
from fastapi.responses import JSONResponse
|
||||
from starlette import status
|
||||
|
||||
|
|
@ -55,6 +55,12 @@ def login(data: schemas.UserLoginSchema = Body(...)):
|
|||
return response
|
||||
|
||||
|
||||
@app.get('/logout', tags=["login", "logout"])
|
||||
def logout_user(response: Response, context: schemas.CurrentContext = Depends(OR_context)):
|
||||
response.delete_cookie("jwt")
|
||||
return {"data": "success"}
|
||||
|
||||
|
||||
@app.post('/{projectId}/sessions/search', tags=["sessions"])
|
||||
@app.post('/{projectId}/sessions/search2', tags=["sessions"])
|
||||
def sessions_search(projectId: int, data: schemas.FlatSessionsSearchPayloadSchema = Body(...),
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue