Uh oh!
There was an error while loading. Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork 3.8k
fix(signup): show multiple signup errors at once#3987
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
Merged
Uh oh!
There was an error while loading. Please reload this page.
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Uh oh!
There was an error while loading. Please reload this page.
Jump to
Jump to file
Failed to load files.
Loading
Uh oh!
There was an error while loading. Please reload this page.
Diff view
Diff view
There are no files selected for viewing
46 changes: 27 additions & 19 deletions
46 apps/sim/app/(auth)/reset-password/reset-password-form.tsx
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -228,18 +228,6 @@ function SignupFormContent({ | ||
| emailValidationErrors.length > 0 || | ||
| errors.length > 0 | ||
| ) { | ||
| if (nameValidationErrors.length > 0) { | ||
| setNameErrors([nameValidationErrors[0]]) | ||
| setShowNameValidationError(true) | ||
| } | ||
| if (emailValidationErrors.length > 0) { | ||
| setEmailErrors([emailValidationErrors[0]]) | ||
TheodoreSpeaks marked this conversation as resolved.
Uh oh!There was an error while loading. Please reload this page. | ||
| setShowEmailValidationError(true) | ||
| } | ||
| if (errors.length > 0) { | ||
| setPasswordErrors([errors[0]]) | ||
| setShowValidationError(true) | ||
| } | ||
| setIsLoading(false) | ||
| return | ||
| } | ||
| @@ -400,7 +388,7 @@ function SignupFormContent({ | ||
| /> | ||
| <div | ||
| className={cn( | ||
| 'absolute right-0 left-0 z-10 grid transition-[grid-template-rows] duration-200 ease-out', | ||
| 'grid transition-[grid-template-rows] duration-200 ease-out', | ||
| showNameValidationError && nameErrors.length > 0 | ||
| ? 'grid-rows-[1fr]' | ||
| : 'grid-rows-[0fr]' | ||
| @@ -438,7 +426,7 @@ function SignupFormContent({ | ||
| /> | ||
| <div | ||
| className={cn( | ||
| 'absolute right-0 left-0 z-10 grid transition-[grid-template-rows] duration-200 ease-out', | ||
| 'grid transition-[grid-template-rows] duration-200 ease-out', | ||
| (showEmailValidationError && emailErrors.length > 0) || | ||
| (emailError && !showEmailValidationError) | ||
| ? 'grid-rows-[1fr]' | ||
| @@ -497,7 +485,7 @@ function SignupFormContent({ | ||
| </div> | ||
| <div | ||
| className={cn( | ||
| 'absolute right-0 left-0 z-10 grid transition-[grid-template-rows] duration-200 ease-out', | ||
| 'grid transition-[grid-template-rows] duration-200 ease-out', | ||
| showValidationError && passwordErrors.length > 0 | ||
| ? 'grid-rows-[1fr]' | ||
| : 'grid-rows-[0fr]' | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -26,8 +26,7 @@ export async function POST(request: NextRequest) { | ||
| const validationResult = resetPasswordSchema.safeParse(body) | ||
| if (!validationResult.success) { | ||
| const firstError = validationResult.error.errors[0] | ||
| const errorMessage = firstError?.message || 'Invalid request data' | ||
| const errorMessage = validationResult.error.errors.map((e) => e.message).join(' ') | ||
TheodoreSpeaks marked this conversation as resolved.
Uh oh!There was an error while loading. Please reload this page. | ||
| logger.warn('Invalid password reset request data', { | ||
| errors: validationResult.error.format(), | ||
Oops, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.