-
Notifications
You must be signed in to change notification settings - Fork 406
fix(clerk-js): Type method returns with ClerkError #7213
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
🦋 Changeset detectedLatest commit: f9ad025 The changes in this PR will be included in the next version bump. This PR includes changesets to release 3 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
WalkthroughTightens error typing and error handling in authentication resources: replaces Changes
Sequence Diagram(s)sequenceDiagram
participant Client
participant SignIn as SignInFuture
participant Runner as runAsyncResourceTask
participant API as Backend
Note over Client,SignIn: Old flow (simplified)
Client->>SignIn: finalize(params?)
SignIn->>Runner: run task (no pre-check)
Runner->>API: finalize request
API-->>Runner: response
Runner-->>SignIn: result / error
SignIn-->>Client: returns result (no forced reload)
Note over Client,SignIn: New flow (high-level, changed interactions)
Client->>SignIn: finalize(params?)
SignIn-->>SignIn: preflight check (e.g., createdSessionId) %%#lightblue
alt preflight fails
SignIn-->>Client: returns { error: ClerkRuntimeError } %%#ffdddd
else preflight ok
SignIn->>Runner: run task
Runner->>API: finalize request
API-->>Runner: response
Runner-->>SignIn: { result / error: ClerkError | null }
SignIn-->>Client: returns result
SignIn-->>Client: trigger client.reload() after success %%#ddffdd
end
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes
Poem
Pre-merge checks and finishing touches✅ Passed checks (3 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
Comment |
@clerk/agent-toolkit
@clerk/astro
@clerk/backend
@clerk/chrome-extension
@clerk/clerk-js
@clerk/dev-cli
@clerk/elements
@clerk/clerk-expo
@clerk/expo-passkeys
@clerk/express
@clerk/fastify
@clerk/localizations
@clerk/nextjs
@clerk/nuxt
@clerk/clerk-react
@clerk/react-router
@clerk/remix
@clerk/shared
@clerk/tanstack-react-start
@clerk/testing
@clerk/themes
@clerk/types
@clerk/upgrade
@clerk/vue
commit: |
Description
This PR replaces the
Promise<{ error: unknown }>return type for the newSignInandSignUpAPIs withPromise<{ error: ClerkError | null }>.It also updates some of the errors used by
SignInFutureto useClerkRuntimeErrorand otherClerkError-based errors where appropriate.Checklist
pnpm testruns as expected.pnpm buildruns as expected.Type of change
Summary by CodeRabbit
New Features
Bug Fixes