Skip to content

Disable automatic "re-login" #49

Answered by frankie567
arminvburren asked this question in Q&A
Discussion options

You must be logged in to vote

Hi @arminvburren!

You need to redirect to the /logout endpoint of Fief to clear the session on Fief's side. You can generate with the Python client and make a 302 redirection to it after having cleared your own session: https://docs.fief.dev/integrate/python/#logout_url

Assuming FastAPI, something like this:

@app.get("/logout", name="logout")
async def logout(request: Request, response: Response):
    redirect_uri = request.url_for("index")
    logout_url = fief.logout_url(redirect_uri)

    response = RedirectResponse(logout_url)  # Response redirecting to Fief logout URL
    response.delete_cookie(SESSION_COOKIE_NAME)  # Don't forget to clear our own session cookie

    return response

F…

Replies: 1 comment 4 replies

Comment options

You must be logged in to vote
4 replies
@arminvburren
Comment options

@arminvburren
Comment options

@arminvburren
Comment options

@frankie567
Comment options

Answer selected by arminvburren
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants