-
Notifications
You must be signed in to change notification settings - Fork 283
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
feat(clerk-js,shared): Add a navigateWithError utility for SignIn #2043
Conversation
🦋 Changeset detectedLatest commit: 2b5c1a6 The changes in this PR will be included in the next version bump. This PR includes changesets to release 11 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 |
@@ -134,3 +135,8 @@ export function determineStartingSignInSecondFactor(secondFactors: SignInFactor[ | |||
const resetPasswordStrategies: SignInStrategy[] = ['reset_password_phone_code', 'reset_password_email_code']; | |||
export const isResetPasswordStrategy = (strategy: SignInStrategy | string | null | undefined) => | |||
!!strategy && resetPasswordStrategies.includes(strategy as SignInStrategy); | |||
|
|||
export function navigateWithError(clerk: Clerk, navigate: (to: string) => Promise<unknown>, to: string, err) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd add this method as an internal method on Clerk Singleton. It feels like it's a better home with the current architecture.
a6b4569
to
ab672e7
Compare
58b8c53
to
8409a28
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. Let's add a ticket to make a more uniform solution to these kind of problems, even if it gets backlogged for now.
8409a28
to
2b5c1a6
Compare
https://linear.app/clerk/issue/SDK-914/determine-a-holistic-solution-for-redirecting-with-an-error |
) (cherry picked from commit 0d1052a)
) (#2074) * feat(clerk-js,shared): Add a navigateWithError utility for SignIn (#2043) (cherry picked from commit 0d1052a) * fix(clekr-js): Correctly return the reject return value --------- Co-authored-by: Mark Pitsilos <mark.pitsilos@gmail.com> Co-authored-by: Nikos Douvlis <nikosdouvlis@gmail.com>
Description
WIP
Checklist
npm test
runs as expected.npm run build
runs as expected.Type of change
Packages affected
@clerk/backend
@clerk/chrome-extension
@clerk/clerk-js
@clerk/clerk-expo
@clerk/fastify
gatsby-plugin-clerk
@clerk/localizations
@clerk/nextjs
@clerk/clerk-react
@clerk/remix
@clerk/clerk-sdk-node
@clerk/shared
@clerk/themes
@clerk/types
build/tooling/chore