Expose error/status callbacks on the prebuilt <SignIn /> component (e.g. incorrect password, rate limiting)
还没有人认领这个 Issue。
评估
- 难度
- 4/5
- 预计耗时
- 3-5 天
- 新手友好度
- 48/100
- Issue 类型
- 功能
- 描述清晰度
- 基本清楚
- 活跃度
- 活跃
- 技术栈
- react, typescript
调研方向
从 @clerk/clerk-react 中预构建的 入口点开始,跟踪其内部表单提交如何处理失败。检查 ClerkAPIError[] 以及 form_password_incorrect 和 too_many_requests 等 code 的表示方式,然后确定失败登录尝试所需的 callback 行为和覆盖范围。
由索引模型根据 Issue 内容生成。
描述
Is your feature request related to a problem?
The prebuilt <SignIn /> component (@clerk/clerk-react) handles the full sign-in flow internally but doesn't expose any way to observe failures — incorrect password, rate limiting (429s), locked accounts, etc. There's no onError prop, no emitted event, and no documented way to read the failure reason from useSignIn() when the failure happened inside the component's own internal form submission (not one we drive ourselves).
As a workaround, we've had to monkey-patch window.fetch to sniff HTTP status codes for requests to our Clerk FAPI domain, just to detect a 429 and show a "too many attempts, retry in Ns" banner:
window.fetch = async (...args) => {
const response = await originalFetch(...args);
if (url.includes(CLERK_DOMAIN) && response.status === 429) {
// surface a rate-limit banner
}
return response;
};
This is fragile (breaks on any internal FAPI change), duplicated per-app, and can't distinguish error reasons (wrong password vs. locked vs. rate-limited) — only status codes.
Describe the solution you'd like
An onError (or onStatusChange) prop on <SignIn /> that fires with Clerk's structured error info (e.g. ClerkAPIError[] with codes like form_password_incorrect, too_many_requests) whenever an internal sign-in attempt fails — without requiring us to reimplement the form via the headless useSignIn() hook just to get error visibility.
Describe alternatives you've considered
- Rebuilding the whole sign-in form with
useSignIn()to get error access — loses all the built-in UI/appearance theming<SignIn />gives us for free. - Patching
window.fetch— fragile, non-public API surface, no error-code granularity.
Happy to contribute a PR if maintainers can point at the right place to emit this.
- 主要语言
- TypeScript
- 星标
- 1.8k
- 派生
- 472
- 平均合并
- 2 天 8 小时
- 30 天内合并 PR
- 184
贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
clerk/javascript 的其他 Issue
-
难度 2/5 1-3 小时 新手友好度 74/100
clerk/javascript#9611 · 1 条评论 ·
-
难度 2/5 1-3 小时 新手友好度 86/100
clerk/javascript#9573 ·
-
难度 4/5 3-5 天 新手友好度 64/100
clerk/javascript#9775 · 1 条评论 ·
-
难度 3/5 1-2 天 新手友好度 68/100
clerk/javascript#9667 · 1 条评论 ·
-
难度 4/5 3-5 天 新手友好度 52/100
clerk/javascript#9659 · 1 条评论 ·
相似的 Issue
-
难度 2/5 1-3 小时 新手友好度 84/100
copse-dev/agent-pane#2953 ·
-
难度 2/5 1-3 小时 新手友好度 84/100
Eynzof/Hermes-CN-Desktop#610 ·
-
bug clawsweeper:linked-pr-open clawsweeper:needs-live-repro clawsweeper:no-new-fix-pr impact:message-loss issue-rating: 🐚 platinum hermit P2 regression
难度 2/5 1-3 小时 新手友好度 78/100
-
enhancement
难度 2/5 1-3 小时 新手友好度 68/100
-
calcite-components needs triage refactor
难度 2/5 1-3 小时 新手友好度 75/100
Esri/calcite-design-system#15203 ·