ClerkAPIError drops meta.lockout_expires_in_seconds from user_locked errors
維護者通常 1 天內回覆
還沒有人認領這個 Issue。
評估
- 難度
- 2/5
- 預估耗時
- 1-3 小時
- 新手友好度
- 78/100
- Issue 類型
- 缺陷
- 描述清晰度
- 描述清楚
- 活躍度
- 活躍
- 技術堆疊
- typescript
研究方向
從 packages/shared/src/errors/clerkApiError.ts 中第 21-38 行附近的中繼資料解析開始,這裡 ClerkAPIError 會根據已知鍵建構 meta。追蹤原始 user_locked 回應如何轉換為公開錯誤,然後確認 lockout_expires_in_seconds 是否以 lockoutExpiresInSeconds 的形式保留,並且呼叫端仍可使用它。
由索引模型根據 Issue 內容生成。
描述
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:
- Enable user lockout on an instance (e.g. 10 attempts, 60 minutes).
- Sign in with a phone code and submit wrong codes until the attempt returns
user_locked. - Inspect the network response:
errors[0].meta.lockout_expires_in_secondsis present (e.g.3599). - Inspect the thrown
ClerkAPIResponseError:errors[0].metahas 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
- 主要語言
- TypeScript
- 星號
- 1.8k
- 分支
- 479
- 平均合併
- 1 天 21 小時
- 30 天內合併 PR
- 308
環境準備
- 沒有 Dockerfile 或 Docker Compose 檔案
- 有 Pull Request 範本
- 閱讀貢獻指南
從這裡開始
- 先讀完整個 Issue,再讀專案的貢獻指南。
- 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
- Fork 儲存庫,在一個分支上完成修改。
- 送出 Pull Request,並在描述裡引用這個 Issue 編號。
clerk/javascript 的其他 Issue
-
@clerk/nextjs: onBeforeSetActive never settles when invalidateCacheAction rejects (e.g. after a redeploy), so setActive and signOut hang forever可能已有人在做 @RaphaelFakhri 於 11 天前認領。 未關閉
難度 2/5 1-3 小時 新手友好度 78/100
clerk/javascript#9987 · 1 則留言 ·
維護者通常 1 天內回覆
-
難度 4/5 3-5 天 新手友好度 18/100
clerk/javascript#10231 ·
維護者通常 1 天內回覆
-
難度 4/5 3-5 天 新手友好度 25/100
clerk/javascript#10185 · 1 個 reaction ·
維護者通常 1 天內回覆
-
難度 4/5 1-2 天 新手友好度 45/100
clerk/javascript#10118 ·
維護者通常 1 天內回覆
-
難度 5/5 一週以上 新手友好度 35/100
clerk/javascript#10117 ·
維護者通常 1 天內回覆
相似的 Issue
-
community first-timers-only good first issue hacktoberfest help wanted low hanging fruit up-for-grabs
難度 1/5 1 小時以內 新手友好度 90/100
lingdojo/kana-dojo#32663 · 1 則留言 · 5 個 reaction ·
維護者通常 1 天內回覆
-
Admin: Title Separator field can't be cleared (input falls back to "|")可能已有人在做 @emdashbot 今天認領。 未關閉bot:bug bot:in-review
難度 2/5 1-3 小時 新手友好度 80/100
emdash-cms/emdash#4236 · 3 則留言 ·
維護者通常 1 天內回覆
-
PHP workflow streaming requests buffer the full SSE response可能已有人在做 @Winoren 今天認領。 未關閉review: medium
難度 2/5 1-3 小時 新手友好度 84/100
langgenius/dify#44270 · 1 則留言 · 1 個 reaction ·
維護者通常 1 天內回覆
-
area:holodeck review-finding
難度 2/5 1-3 小時 新手友好度 62/100
hyperdrive-technology/holodeck#142 ·
維護者通常 1 天內回覆
-
難度 1/5 1 小時以內 新手友好度 90/100
code-yeongyu/senpi#3573 ·
維護者通常 1 天內回覆