Conversation
CAL-981 Admin password change has incoherent/obsolete information
There are two issues with this:
|
|
The latest updates on your projects. Learn more about Vercel for Git ↗︎
1 Ignored Deployment
|
| "password_hint_admin_min": "Minimum 15 characters long", | ||
| "password_hint_num": "Contain at least 1 number", | ||
| "invalid_password_hint": "The password must be a minimum of 7 characters long containing at least one number and have a mixture of uppercase and lowercase letters", | ||
| "invalid_password_hint": "The password must be a minimum of 15 characters long containing at least one number and have a mixture of uppercase and lowercase letters", |
There was a problem hiding this comment.
the 15 character minimum limit is only for the admin role. for other 7 characters are still allowed. maybe just check if the user role is admin then show the 15 character password hint else 7 chars.
There was a problem hiding this comment.
i'll update those changes 🙌🏼 . do we still have the number, uppercase and uppercase requirement for a normal user ?
There was a problem hiding this comment.
i'm planning on to convert the hardcoded number into a template variable.
There was a problem hiding this comment.
check lib/auth
export function validPassword(password: string) {
if (password.length < 7) return false;
if (!/[A-Z]/.test(password) || !/[a-z]/.test(password)) return false;
if (!/\d+/.test(password)) return false;
return true;
}
I agree with @Udit-takkar, perhaps you can use the same hints shown when signing-up in website here: https://cal.com/signup. It is based on zod and uses our custom inputs to digest them. Happy to help there, I implemented it. |
|
pushed some changes:
Screencast.2023-02-07.22.52.25.webmcc: @Udit-takkar @leog |
45329e7 to
8960def
Compare
…erentobsolete-information
|
@Udit-takkar pushed a fix for the regex Screencast.2023-02-09.07.20.41.webm |



What does this PR do?
Fixes #6842
to reproduce locally:
issue:
Screencast.2023-02-07.08.21.45.webm
after:
Screencast.2023-02-07.07.25.36.webm
changes:
Environment: Staging(main branch) / Production
Type of change