Disable automatic "re-login" #49
-
So I have integrated fief to my website https://simu-immo.fr works well (with brave 2 users right now!). One problem is that I cant easily "change account". Why ? If I disconnect through the my logout page, and go through login again, fief will automatically connect me to the last account i entered into fief (you can probably verify this by yourself on the website right now). The only way to change account is to manually remove the fief cookie in my browser. Is it possible to remove the fact it automatically connects on the last login ? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 4 replies
-
Hi @arminvburren! You need to redirect to the 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 Fief will automatically redirect the user back to the URL you give (e.g. your index page). |
Beta Was this translation helpful? Give feedback.
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_urlAssuming FastAPI, something like this:
F…