Skip to content

Force Auth0 login prompt for account-linking's second identity - #67

Merged
paulyhedral merged 2 commits into
developfrom
fix/link-prompt-login
Oct 3, 2026
Merged

paulyhedral merged 2 commits into
developfrom
fix/link-prompt-login

Conversation

@paulyhedral

Copy link
Copy Markdown
Contributor

Summary

linkStart's authorizeURL call never passed prompt=login. A visitor who already has an
active Auth0 SSO session (from their first identity) got silently re-authenticated as that
same identity and bounced straight back through /auth/link/callback - no chance to enter a
different account's credentials, which from the UI looked like "click link, page loads and
comes back immediately."

Added prompt support to Auth0Config.authorizeURL and pass prompt=login specifically from
linkStart, forcing Auth0's credentials screen even with an active SSO session. The normal
/auth/login path is unaffected - no prompt argument passed there, same behavior as before.

Found while testing link-user-accounts (sweetrpg/platform#70) on dev, after a separate
Auth0 Allowed Callback URLs config fix.

Test plan

  • swift build - clean
  • swift test (full suite, 25/25) - pass
  • swift format lint --recursive --strict Sources Tests - clean
  • Verify on dev after merge: linking a second identity now shows Auth0's login screen
    instead of silently completing with the same identity

linkStart's authorizeURL call never passed prompt=login, so a visitor
with an active Auth0 SSO session (from their first identity) got
silently re-authenticated as that same identity and bounced straight
back through link/callback - no chance to enter a different account's
credentials. Add prompt= support to authorizeURL and pass prompt=login
specifically for the link flow; the normal /auth/login path is
unaffected (no prompt argument passed there).
@paulyhedral paulyhedral added the bug Something isn't working label Oct 3, 2026
@paulyhedral paulyhedral self-assigned this Oct 3, 2026
LinkStartTests, UsersAPIClientLinkCompleteTests, and ProvisionedUserIDTests
each mutated the process-global USERS_API_URL env var via setenv/unsetenv,
each marked .serialized - but .serialized only orders tests within one
suite, not across suites, so Swift Testing's cross-suite parallelism raced
them against each other. One suite's fake-server URL could leak into
another suite's in-flight request mid-test. Observed in CI as PR #67's
'a users-api link/start failure surfaces as a 503' test getting a spurious
404 instead - the request landed on a different suite's fake server, which
had no matching route for /internal/identities/link/start.

Merging the three suites into one .serialized suite makes all tests that
share this mutable state truly serialize against each other. Verified by
running the full suite 3x locally with no failures (previously flaky).
@paulyhedral
paulyhedral merged commit dfb5cdb into develop Oct 3, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant