Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

ClerkAPIError drops meta.lockout_expires_in_seconds from user_locked errors

Aperta Adatta ai principianti
#10,026 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
2/5
Tempo stimato
1-3 ore
Idoneità per principianti
78/100
Tipo di issue
Bug
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
typescript

Direzione di ricerca

Inizia in packages/shared/src/errors/clerkApiError.ts, nell’analisi dei metadati intorno alle righe 21-38, dove ClerkAPIError costruisce meta a partire da chiavi note. Segui il modo in cui la risposta grezza user_locked viene convertita nell’errore pubblico, quindi verifica che lockout_expires_in_seconds venga preservato come lockoutExpiresInSeconds e rimanga disponibile per i chiamanti.

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
  • This issue is not a question, general help request, or anything other than a bug report directly related to Clerk
Reproduction

The bug is visible in the source, no project needed: https://github.com/clerk/javascript/blob/main/packages/shared/src/errors/clerkApiError.ts#L21-L38

Publishable key

Not needed: the behavior does not depend on an instance, it is in the error parser.

Description

When an account reaches the user lockout threshold, the Frontend API answers the failed attempt with 403 user_locked and includes how long the lockout lasts in meta.lockout_expires_in_seconds. ClerkAPIError builds its meta from a fixed list of known keys (param_name, session_id, identifiers, zxcvbn, plan, …), so lockout_expires_in_seconds is dropped and the app cannot tell the user when they can try again.

Steps to reproduce:

  1. Enable user lockout on an instance (e.g. 10 attempts, 60 minutes).
  2. Sign in with a phone code and submit wrong codes until the attempt returns user_locked.
  3. Inspect the network response: errors[0].meta.lockout_expires_in_seconds is present (e.g. 3599).
  4. Inspect the thrown ClerkAPIResponseError: errors[0].meta has no lockout field.

Expected behavior:

ClerkAPIError.meta exposes the lockout duration (e.g. lockoutExpiresInSeconds), the same way ClerkAPIResponseError.retryAfter already exposes Retry-After for too_many_requests, so apps can show a countdown or hide "resend code" until the lockout ends.

Actual behavior:

The value is discarded during parsing. The only way to read it is to bypass the SDK and parse the raw response.

Environment
@clerk/shared 4.31.0 (also on main as of 2026-10-01)
@clerk/clerk-expo, React Native (Expo SDK), iOS and Android
Lingua principale
TypeScript
Stelle
1.8k
Fork
477
Merge medio
2g 3h
PR unite (30g)
269

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di clerk/javascript

Tutte le issue di clerk/javascript

Issue simili

Altre issue su TypeScript

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.