`signIn.reset()` / `client.resetSignIn()` don't propagate a fresh empty SignIn to the Future `useSignIn()` hook, so `sso()` after reset reuses the stale resource and never navigates
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Idoneità per principianti
- 48/100
- Tipo di issue
- Bug
- Chiarezza
- Abbastanza chiara
- Stato di attività
- Tranquilla
- Stack tecnologico
- nextjs, typescript
- Ambito
- authentication
Direzione di ricerca
Inizia dal punto di ingresso Future useSignIn() e dal percorso signIn.reset()/clerk.client.resetSignIn(); riproduci il flusso di chiusura della passkey, quindi chiama immediatamente sso(). È completato quando reset espone o propaga un nuovo SignInFuture vuoto, in modo che il successivo sso() avvii OAuth e navighi senza dipendere da __internal_future.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Preliminary Checks
-
I have reviewed the documentation: https://clerk.com/docs
-
I have searched for existing issues: https://github.com/clerk/javascript/issues
-
I have not already reached out to Clerk support via email or Discord (if you have, no need to open an issue here)
-
This issue is not a question, general help request, or anything other than a bug report directly related to Clerk. Please ask questions in our Discord community: https://clerk.com/discord.
Reproduction
https://github.com/clerk/javascript
Publishable key
pk_test_1234
Description
Summary
I'm using the Future custom-flow hooks (useSignIn() from @clerk/nextjs, not /legacy). When I reset an in-progress sign-in, the reset doesn't propagate a new empty SignInFuture resource to the hook's signIn. The only way I've found to get the live post-reset resource at call-time is the internal clerk.client.signIn.__internal_future. Your support team confirmed this: "our existing reset pathway doesn't result in the propagation of a new empty SignIn for the new hooks."
Environment
@clerk/nextjs@7.3.4@clerk/shared@4.11.0clerk-js@6.11.0- Default import:
import { useSignIn } from '@clerk/nextjs'(Future API, not/legacy)
Reproduction
Custom SSO flow built on useSignIn():
- Leave an in-progress
SignIn. Easiest way is to start a discoverable passkey (signIn.passkey({ flow: 'discoverable' })) and then dismiss the WebAuthn prompt, which persists asignInwith anid. - In a single click handler, call
await signIn.reset()(orclerk.client.resetSignIn()). - Immediately call
await signIn.sso({ strategy: 'oauth_google', redirectUrl, redirectCallbackUrl }).
Expected
sso() starts a fresh OAuth attempt and navigates to the provider.
Actual
sso() PATCH-continues the stale (pre-reset) SignIn and resolves without navigating, so the SSO button just hangs. The signIn reference captured in my handler's closure is the pre-reset one, and since the SignInFuture resource has an intentionally unstable identity and reset doesn't refresh the hook's value, the closure can never see the new resource within the same handler. A memo dep array only affects future invocations, not the one that's already running.
Workaround
I read the live resource at call-time from the internal field:
if (clerk.client?.signIn.id) clerk.client.resetSignIn();
const resource = clerk.client?.signIn.__internal_future ?? signIn;
await resource.sso({ ... });
This leans on __internal_future, which is internal and can break between minor versions, for what's otherwise a completely ordinary flow (reset a stale sign-in, then start SSO).
Suggested fixes (any one of these would let me drop __internal_future)
reset()resolves with the freshSignInFutureresource, or- a public accessor for the live resource (something like
clerk.client.signInFuture), or reset()propagates a new emptySignInto theuseSignIn()hook so callingsso()on the hook'ssignInworks after a reset.
Environment
I was told by support I didn't need to provide any of this:
> Thanks for the info! I think the best way to follow this would be to file an issue on our GitHub repo for the JavaScript SDKs https://github.com/clerk/javascript. A minimal reproduction would be incredible if you can toss one together, but totally fine if not. I took a quick look and I do think you're right on the money that our existing reset pathway doesn't result in the propagation of a new empty SignIn for the new hooks.
- Lingua principale
- TypeScript
- Stelle
- 1.8k
- Fork
- 472
- Merge medio
- 2g 12h
- PR unite (30g)
- 222
Guida per i contributori
Apri la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di clerk/javascript
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 74/100
clerk/javascript#9611 · 1 commento ·
-
clerk/javascript#9891 · 1 assegnatario ·
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 64/100
clerk/javascript#9775 · 1 commento ·
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 48/100
clerk/javascript#9770 · 3 commenti ·
-
Difficoltà 3/5 1-2 giorni Idoneità per principianti 68/100
clerk/javascript#9667 · 1 commento ·
Tutte le issue di clerk/javascript
Issue simili
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 70/100
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
mksglu/context-mode#1200 ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
jaegertracing/jaeger-ui#4506 ·
-
area:desktop area:ui bug platform:macos
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
anthropics/claude-code#96687 ·
-
good first issue
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 95/100
AOSSIE-Org/DebateAI#582 · 2 commenti ·