Skip to content

feat(auth): send OIDC login_hint for direct email login (PLT-1666) - #2950

Closed
brayansdt wants to merge 1 commit into
mainfrom
bryandichtl/plt-1666-login-hint
Closed

feat(auth): send OIDC login_hint for direct email login (PLT-1666)#2950
brayansdt wants to merge 1 commit into
mainfrom
bryandichtl/plt-1666-login-hint

Conversation

@brayansdt

Copy link
Copy Markdown
Contributor

What

On the hosted Ory login popup, after the user enters their email in the embedded prompt the popup restarts at step 0 instead of resuming at the OTP screen (Auth0 opened straight on the code screen). PLT-1666.

Root cause: the SDK forwards the email as the custom email query param on /authorize. On the Ory/Hydra path Hydra does not relay custom params to the login UI, so the branded page only ever sees login_challenge and starts over.

Change

Additionally set the standard OIDC login_hint (= the email) on the popup /authorize, alongside the existing email/direct params. Hydra does relay login_hint onto the login request, and Kratos surfaces it on the login flow, so the branded page can pre-fill + auto-send the code. Mirrored in the standalone/NextAuth popup builder.

  • Auth.ts buildExtraQueryParams (main popup path)
  • login/standalone.ts buildAuthorizationUrl (standalone path)

Additive and Auth0-safe: the Auth0 path still consumes email; login_hint is just an extra standard param it ignores/pre-fills harmlessly.

Paired change

Consumed by the branded page in passport-login (reads oauth2_login_request.oidc_context.login_hint off the flow and auto-sends the code). This SDK change is a no-op until that lands, and vice-versa.

Scope

Email one-time-code method only. Social method resume (no OIDC-standard method hint through Hydra) is a separate follow-up.

Tests

Auth.test.ts — new case asserts login_hint is forwarded for direct email login. Full suite green (20/20); tsc/eslint clean.

The SDK forwards the email entered in the embedded prompt as the custom `email`
query param on /authorize. On the hosted Ory/Hydra login path Hydra does not
relay custom params to the login UI, so the branded page lost the email and
restarted at step 0 instead of resuming at the OTP screen (Auth0 parity).

Also set the standard `login_hint` (which Hydra does relay onto the login
request, and Kratos surfaces on the login flow) alongside the existing `email`
param. Additive — the Auth0 path still uses `email` and is unaffected. Mirrored
in the standalone/NextAuth popup builder. Covered by a new Auth.test.ts case.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@brayansdt
brayansdt requested a review from a team as a code owner August 25, 2026 07:27
@nx-cloud

nx-cloud Bot commented Aug 25, 2026

Copy link
Copy Markdown

View your CI Pipeline Execution ↗ for commit 4fa1a28

Command Status Duration Result
nx affected -t build,test ✅ Succeeded 1m 53s View ↗

☁️ Nx Cloud last updated this comment at 2026-08-25 07:33:06 UTC

@brayansdt

Copy link
Copy Markdown
Contributor Author

Closing in favour of an SDK-free fix. Rather than change the SDK (which needs every game integration to upgrade), we promote the SDK's custom email param to the standard OIDC login_hint at the CDN — in the passport-auth-route CloudFront Function on /authorize — matching that function's existing 'translate at the CDN so SDKs stay unchanged' design. The branded-page side (passport-login#237) is unchanged; it reads oauth2_login_request.oidc_context.login_hint either way. Infra PR to follow.

@brayansdt brayansdt closed this Aug 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant