Skip to content

Offer Continue as on the sign-in page after an AI client sign-in - #1456

Merged
helpcodeai merged 4 commits into
mainfrom
fix/login-continue-recent-sign-in
Nov 2, 2026
Merged

helpcodeai merged 4 commits into
mainfrom
fix/login-continue-recent-sign-in

Conversation

@helpcodeai

Copy link
Copy Markdown
Contributor

What

This follows #1452. In the Claude onboarding, after the post-approve picker, Claude reaches the new connector through "List connectors". That answer links to /connectors/<id>, not to a /s/<token> setup link, so the user was still asked for the password they had typed a minute earlier on the authorization page. A production end-to-end test on Cloud showed it.

Change

  • RecentSignInService (new, in AuthModule).
    • It holds the checks from Open setup links without a second sign-in, in their workspace #1452 on the amcp_signin cookie: signed, httpOnly, not revoked by sessionsValidFrom, e-mail verified on Cloud, no workspace that enforces SSO.
    • It makes dashboard sessions: on the workspace asked for, or else on the one last used, or the first active one.
    • SetupLinksController now uses it, with the same behaviour as before.
  • /api/auth/recent-sign-in (new controller).
    • GET answers which account signed in (e-mail and name only), or 204.
    • POST returns a dashboard session, or 401.
    • DELETE clears the cookie.
  • Sign-in page. Without a dashboard session, it shows "Continue as " above the social buttons, with a one-line hint. It is offered, never automatic. A click opens the session and goes to redirect, through the same afterSignIn as a password sign-in.
  • Dashboard sign-out. It calls DELETE, so the sign-in page offers nothing right after.
  • Translations. New strings in en, de and it.

Cloud and self-hosted

The behaviour is the same in both modes. The cookie only reaches the API when the dashboard and the authorization page share a host; otherwise GET answers 204 and the page looks as before.

Tests

Backend, in packages/backend:

  • npx jest --maxWorkers=4 src/auth/recent-sign-in src/adapters/setup-links.controller.spec.ts src/auth/login.controller.spec.ts: 4 suites passed.
    • New: RecentSignInService (valid, missing, revoked, unverified, SSO-enforced, unknown user; session on the requested, last-used or fallback workspace; none without a membership).
    • New: RecentSignInController (GET, POST, DELETE).
    • SetupLinksController specs moved to the service.
  • npx tsc --noEmit -p tsconfig.json: passed.

Frontend, in packages/frontend:

  • npx tsc --noEmit -p tsconfig.json: passed.
  • npx eslint on the changed files: 0 errors (3 existing warnings).
  • npx playwright test tests/e2e/login-recent-sign-in.spec.ts tests/e2e/setup-link.spec.ts tests/e2e/social-login.spec.ts tests/e2e/login-redirect-safe.spec.ts: 29 passed.

The chat also hands out plain dashboard links (/connectors/<id>) for a
connector that is not set up yet; those still asked for the password a
user had typed a minute earlier to connect Claude. The sign-in page now
offers "Continue as <email>" from the same recent sign-in cookie the
setup links use, with the same checks; signing out forgets it.
@helpcodeai
helpcodeai enabled auto-merge (squash) November 2, 2026 19:02
@helpcodeai
helpcodeai disabled auto-merge November 2, 2026 19:05
Review: seven days left a password-free dashboard sign-in on a shared
browser where someone only connected an AI client. Two hours covers the
setup the chat hands out right after connecting. The requests that turn
the cookie into a session now need a custom header, which a page on
another origin (a sibling subdomain included) cannot send.
@helpcodeai
helpcodeai enabled auto-merge (squash) November 2, 2026 19:22
@helpcodeai
helpcodeai merged commit 75451d3 into main Nov 2, 2026
14 checks passed
@helpcodeai
helpcodeai deleted the fix/login-continue-recent-sign-in branch November 2, 2026 20:11
@github-actions github-actions Bot locked and limited conversation to collaborators Nov 2, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant