Exemple #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}
Exemple #2
0
def logout(response: Response):
    response.delete_cookie(key=config.auth_token_name)
    return Message(message='Logged out')
Exemple #3
0
 async def end_session(self, session_id: str, response: Response):
     response.delete_cookie(self.model.name)
     await self.backend.remove(session_id)
Exemple #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)
Exemple #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
Exemple #6
0
def delete_cookie(response: Response):
    response.delete_cookie("fakesession")
    return {"cookies deleted"}
Exemple #7
0
def bye_bye(response: Response):
	response.delete_cookie(key="session_token",path="/")
	response.status_code = 307
	response.headers['Location'] = "/"
	return response
Exemple #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
Exemple #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)
Exemple #11
0
async def logout(response: Response) -> dict:
    response.delete_cookie(key="access_token")
    return {"status": "ok"}
Exemple #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='/')
Exemple #13
0
def logout_route(response: Response):
    response.delete_cookie("session")

    return {"detail": "Logout Successfully!"}
Exemple #14
0
async def logout_user(response: Response) -> None:
    response.delete_cookie("user")
Exemple #15
0
async def revoke_credential(r: Response):
    r.delete_cookie('q_c0', path='/')
Exemple #16
0
async def user_logout(response: Response):
    response.delete_cookie(key="access_token")
    message = {"message": "User is logout"}
    return message
Exemple #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')
Exemple #18
0
 async def logout(*, response: Response):
     response.delete_cookie(access_cookie_name)
     response.delete_cookie(refresh_cookie_name)
     return None
Exemple #19
0
 async def login(request: Request, response: Response):
     response.delete_cookie('ref')