From 60cd08adc917912a0c4da848a7ee9d38e9276115 Mon Sep 17 00:00:00 2001 From: giles Date: Mon, 23 Feb 2026 11:44:47 +0000 Subject: [PATCH] Add /auth/clear endpoint to reset session cookies Co-Authored-By: Claude Opus 4.6 --- infrastructure/oauth.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/infrastructure/oauth.py b/infrastructure/oauth.py index 6c5dd83..a1cb3a5 100644 --- a/infrastructure/oauth.py +++ b/infrastructure/oauth.py @@ -120,6 +120,16 @@ def create_oauth_blueprint(app_name: str) -> Blueprint: return redirect(next_url, 303) + @bp.get("/clear") + @bp.get("/clear/") + async def clear(): + """One-time migration helper: clear all session cookies.""" + qsession.clear() + resp = redirect("/") + resp.delete_cookie("blog_session", domain=".rose-ash.com", path="/") + resp.delete_cookie("sso_hint", domain=".rose-ash.com", path="/") + return resp + @bp.post("/logout") @bp.post("/logout/") async def logout():