From 4540746da2b14dce09290809bc85537fcf290462 Mon Sep 17 00:00:00 2001 From: inference-bot Date: Tue, 29 Sep 2026 21:53:59 -0600 Subject: [PATCH] Logout: clear session + explicit logged-out page (Cloudron has no RP-initiated logout; silent re-auth was the bug) --- app/main.py | 39 +++++++++++++++++++++++++++++++++++++-- 1 file changed, 37 insertions(+), 2 deletions(-) diff --git a/app/main.py b/app/main.py index adb335d..f1bce20 100644 --- a/app/main.py +++ b/app/main.py @@ -199,9 +199,44 @@ async def oidc_callback(request: Request): @app.get("/logout") -async def logout(): - resp = RedirectResponse("/", status_code=302) +async def logout(request: Request): + """Log out: clear our session, then show an explicit logged-out page. + + Cloudron's OIDC provider removed its RP-initiated logout endpoint (forum: + "no app supports this properly"), so we cannot end the SSO session + programmatically. Redirecting to / would silently re-authenticate through + the still-valid SSO cookie — the "logout does nothing" bug. Instead we + clear our cookies and show a page with a manual link to sign out of + Cloudron SSO (my.inference.coop/logout) for a full sign-out. + """ + html = """ +Logged out — Inference Cooperative + +
+

You're logged out

+

Your dashboard session has been cleared.

+

Note: you may still be signed in to Inference Cooperative SSO + (chat, portal, forum share that sign-in). To fully sign out everywhere, + log out of your Cloudron account too.

+

Sign out of SSO

+

Log back in

+
""" + resp = HTMLResponse(html) resp.delete_cookie(oidc.SESSION_COOKIE) + resp.delete_cookie("oidc_state") + resp.delete_cookie("oidc_nonce") return resp