Hacktoberfest 2026 : les issues que les mainteneurs ont marquées pour octobre, ouvertes et accessibles aux débutants. Parcourir les issues Hacktoberfest

handleRedirectCallback is not idempotent: SSO callback runs twice and the second signUp.create({ transfer: true }) fails with "There is no account to transfer"

Ouverte
#10,510 0 commentaires 0 réactions 0 personnes assignées Voir sur GitHub

Les mainteneurs répondent en général sous 1 jour

Personne n'a encore pris cette issue.

Évaluation

Difficulté
4/5
Temps estimé
3-5 jours
Accessibilité débutants
45/100
Type d'issue
Bug
Clarté
Clairement spécifiée
Activité
Active
Stack technique
next.js, react, typescript

Piste de recherche

Start with the three named entry points: packages/ui/src/common/SSOCallback.tsx, packages/clerk-js/src/core/clerk.ts, and packages/react/src/isomorphicClerk.ts. Trace the callback effect and redirect handling, then locate tests for these paths and reproduce the duplicate call behavior. Done means repeated handling of one OAuth return does not create duplicate transfers and callback rejections reach the caller.

Rédigé par le modèle d'indexation à partir du texte de l'issue.

Description

Preliminary Checks
Reproduction

Source-level, see Description. No minimal repro: the double mount happens in real Chrome and Firefox but never in headless Chromium.

Publishable key

N/A

Description

After going from @clerk/nextjs 7.7.9 to 7.9.17, new users signing up with Google via the prebuilt <SignIn> started failing with "There is no account to transfer". Same clerk-js (6.39.0) before and after. Before: every new-user OAuth return sent one transfer. After: most sent two, and the second one failed.

Steps to reproduce:

  1. Prebuilt <SignIn> on a path-routed page, Google OAuth on, legal consent required
  2. Continue with Google using a Google account that has no Clerk user
  3. Finish Google consent, land on /sign-in/sso-callback

Expected behavior:

One POST /v1/client/sign_ups?transfer=true, then the legal consent step.

Actual behavior:

Two POST /v1/client/sign_ups?transfer=true, 4 to 200 ms apart. The first creates the sign-up (missing_requirements). The second fails with account_transfer_invalid and the user is sent back to sign-in. Once both succeeded and left two half done sign-ups.

The SignIn tree mounts twice. On a plain /sign-in load in real Chrome, useAutoFillPasskey sends two identical POST /v1/client/sign_ins in the same ms with different ids:
https://github.com/clerk/javascript/blob/6857df6841fb044f88e69f978917d8b8e8040d67/packages/ui/src/components/SignIn/SignInStart.tsx#L60

So SSOCallback calls handleRedirectCallback twice. Nothing stops the second call:

Workaround: own sso-callback page that calls window.Clerk.handleRedirectCallback once per callback URL per page load.

Ask:

  1. Make handleRedirectCallback idempotent per OAuth return (or dedupe in-flight calls)
  2. Let IsomorphicClerk pass the rejection through
Environment
@clerk/nextjs 7.9.17, @clerk/react 6.17.8, @clerk/shared 4.40.0, clerk-js 6.39.0 to 6.41.0, @clerk/ui 1.42.0, next 16.4.1, react 19.2.8, Chrome and Firefox (current stable)
Langage dominant
TypeScript
Étoiles
1.8k
Forks
483
Merge moyen
1 j 20 h
PR mergées (30 j)
363

Préparer son environnement

Par où commencer

  1. Lisez l'issue en entier, puis le guide de contribution du projet.
  2. Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
  3. Forkez le dépôt et travaillez sur une branche.
  4. Ouvrez une pull request qui référence le numéro de l'issue.

Autres issues de clerk/javascript

Toutes les issues de clerk/javascript

Issues similaires

Plus d'issues TypeScript

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.