Skip to content

fix(auth): signing out of Lens signs out of every Elcano app - #29

Merged
jzhao234 merged 2 commits into
mainfrom
feat/logout-everywhere
Sep 16, 2026
Merged

jzhao234 merged 2 commits into
mainfrom
feat/logout-everywhere

Conversation

@jzhao234

Copy link
Copy Markdown
Contributor

TLDR

Lens's logout used to end only the Lens session; the central Auth session stayed alive, so any app signed the user straight back in. Logout now hands the browser to Auth's sign-out endpoint, which ends the central session, tells every registered application to drop its sessions, and lands on Auth's login page.

Problem

POST /logout revoked the local session and redirected to /signed-out while the Auth session lived on. With Fleet's silent SSO start and Explorer's automatic handoff, "log out" appeared to do nothing.

Fix

  • After revoking the local session and clearing the cookie, redirect to <AUTH_ISSUER_URL>/logout?client_id=<AUTH_CLIENT_ID> (Auth's RP-initiated logout, ElcanoTek/auth#36), which revokes every central session, fans the back-channel logout out to every application (Lens included; idempotent), and shows Auth's login page with a notice.
  • /signed-out stays for direct visits. Deploy Auth first (older Auth answers 405 to the GET).

Tests

  • test_central_logout_stays_signed_out_until_the_user_chooses_to_sign_in asserts the redirect targets http://auth.example.com/logout?client_id=lens and still exercises /signed-out directly.
  • ruff check, ruff format --check, full suite 335 passed.

TLDR

Lens's logout used to end only the Lens session; the central Auth session
stayed alive, so any app signed the user straight back in. Logout now hands
the browser to Auth's sign-out endpoint, which ends the central session,
tells every registered application to drop its sessions, and lands on Auth's
login page.

Problem

POST /logout revoked the local session and redirected to /signed-out while
the Auth session lived on. With Fleet's silent SSO start and Explorer's
automatic handoff, "log out" appeared to do nothing.

Fix

- After revoking the local session and clearing the cookie, redirect to
  `<AUTH_ISSUER_URL>/logout?client_id=<AUTH_CLIENT_ID>` (Auth's RP-initiated
  logout, ElcanoTek/auth#36), which revokes every central session, fans the
  back-channel logout out to every application (Lens included; idempotent),
  and shows Auth's login page with a notice.
- /signed-out stays for direct visits. Deploy Auth first (older Auth answers
  405 to the GET).

Tests

- test_central_logout_stays_signed_out_until_the_user_chooses_to_sign_in
  asserts the redirect targets http://auth.example.com/logout?client_id=lens
  and still exercises /signed-out directly.
- ruff check, ruff format --check, full suite 335 passed.
README and DEPLOYMENT still said central logout ended only the Lens session
and landed on /signed-out; the test was named for that. Both now match the
redirect to Auth's RP-initiated logout; /signed-out stays a direct-visit page.
@jzhao234
jzhao234 merged commit 2bd28b0 into main Sep 16, 2026
7 checks passed
@jzhao234
jzhao234 deleted the feat/logout-everywhere branch September 16, 2026 02:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant