-
Notifications
You must be signed in to change notification settings - Fork 6
fix: leading and trailing spaces issue while password matching #101
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
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -81,10 +81,10 @@ export const PlanDetailsRegisterPageSchema = () => (z.object({ | |
| username: z.string().trim() | ||
| .min(2, 'Username must be between 2 and 30 characters long.') | ||
| .max(30, 'Username must be between 2 and 30 characters long.'), | ||
| password: z.string() | ||
| password: z.string().trim() | ||
| .min(2, 'This password is too short. It must contain at least 2 characters.') | ||
| .max(75, 'This password is too long. It must contain no more than 75 characters.'), | ||
| confirmPassword: z.string() | ||
| confirmPassword: z.string().trim() | ||
| .min(8, 'Please confirm your password') | ||
| .max(75, 'This password is too long. It must contain no more than 75 characters.'), | ||
|
Comment on lines
+84
to
89
|
||
| country: z.string().trim() | ||
|
|
||
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.
The minimum length validation for
confirmPasswordis inconsistent with thepasswordfield. Thepasswordfield requires a minimum of 2 characters, butconfirmPasswordrequires a minimum of 8 characters. These should be the same value.Change line 88 to:
This inconsistency would cause validation errors when users enter matching passwords between 2-7 characters.