Ejemplo n.º 1
0
async def logout(response: Response, request: Request, token: Optional[str] = Security(api_key)):

    await SessionManager.del_session(request.state.db, token)
    response.delete_cookie(key='token')
    return {'success': True}
Ejemplo n.º 2
0
def logout(response: Response):
    response.delete_cookie(key=config.auth_token_name)
    return Message(message='Logged out')
Ejemplo n.º 3
0
 async def end_session(self, session_id: str, response: Response):
     response.delete_cookie(self.model.name)
     await self.backend.remove(session_id)
Ejemplo n.º 4
0
 async def get_logout_response(self, user: BaseUserDB,
                               response: Response) -> Any:
     response.delete_cookie(self.cookie_name,
                            path=self.cookie_path,
                            domain=self.cookie_domain)
Ejemplo n.º 5
0
async def logout(response: Response):  # pragma: no cover
    response.delete_cookie("access_token")
    response.delete_cookie("refresh_token")
    response.delete_cookie("access_token_expire")
    return
Ejemplo n.º 6
0
def delete_cookie(response: Response):
    response.delete_cookie("fakesession")
    return {"cookies deleted"}
Ejemplo n.º 7
0
def bye_bye(response: Response):
	response.delete_cookie(key="session_token",path="/")
	response.status_code = 307
	response.headers['Location'] = "/"
	return response
Ejemplo n.º 8
0
def logout(response: Response):
    response.delete_cookie("session")
    return {"success": True}
def logout(token: str = Depends(oauth2_scheme), db=Depends(get_db)):
    auth_service.save_revoked_token(token, db)

    response = Response()
    response.delete_cookie("access_token")
    return response
Ejemplo n.º 10
0
async def logout(response: Response):
    """
    Logout the user by deleting all tokens. Only unexpired tokens can logout.
    """
    del response.headers['authorization']
    response.delete_cookie(REFRESH_TOKEN_KEY)
Ejemplo n.º 11
0
async def logout(response: Response) -> dict:
    response.delete_cookie(key="access_token")
    return {"status": "ok"}
Ejemplo n.º 12
0
def logout(response: Response, cookie: str = Cookie(None)):
    if cookie not in app.sessions:
        return RedirectResponse(url='/')
    response.delete_cookie(key='cookie')
    app.sessions.clear()
    return RedirectResponse(url='/')
Ejemplo n.º 13
0
def logout_route(response: Response):
    response.delete_cookie("session")

    return {"detail": "Logout Successfully!"}
Ejemplo n.º 14
0
async def logout_user(response: Response) -> None:
    response.delete_cookie("user")
Ejemplo n.º 15
0
async def revoke_credential(r: Response):
    r.delete_cookie('q_c0', path='/')
Ejemplo n.º 16
0
async def user_logout(response: Response):
    response.delete_cookie(key="access_token")
    message = {"message": "User is logout"}
    return message
Ejemplo n.º 17
0
def logout(response: Response):
    '''
    Removes the 'Authorization' cookie. However, the signed JWT remains valid, until it gets expired automatically.
    '''

    response.delete_cookie('Authorization')
Ejemplo n.º 18
0
 async def logout(*, response: Response):
     response.delete_cookie(access_cookie_name)
     response.delete_cookie(refresh_cookie_name)
     return None
Ejemplo n.º 19
0
 async def login(request: Request, response: Response):
     response.delete_cookie('ref')