-
Notifications
You must be signed in to change notification settings - Fork 1k
chore(auth): add password validation to dbAuth resetPassword handler #10734
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
Thank you for the PR, I'm surprised no one has noticed until now! I think this should be the default, and always enabled. I can't think of a realistic scenario where you have requirements for a password, but if you reset your password you should be able to do anything you want. I'd release this in the next patch. The fact that no one has noticed tells me they also won't know/care when we implement the correct behavior going forward. @irg1008 Would you mind adding a changeset for this PR? Just run |
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.
Could we add a quick test showing that if passwordValidation
is not defined in this.options.signup
that no error is thrown? Even if your password is just a single character.
Okay that is done. |
Okay I fixed some things and I think it's ready to go. If you need anything else please say so! |
Sorry I though I fixed that error locally... |
Hmm getting a couple of test failures in the dbAuth package...can you try running these locally and see if you get them as well @irg1008 ?
At first glance they don't seem to be related to your PR, but I don't get the failures in |
Okay fixed 100% (99.999%). Sorry for all the fuss Built and tested locally |
A little side note. Would be possible to test in redwood using vitetest instead of jest (it's so much faster) |
We'll likely have this released in v.7.7.0 on Tuesday. I think this package uses vitest already? We've been converting our own packages over from jest to vitest. For redwood projects themselves we do plan to transition from jest to vitest too. That work is probably at least a month or two down the line at the moment - we haven't prioritised or scheduled that work yet. |
…10734) Related to #10724. This pull request adds password validation on resetPassword handler using the one from the signup handler. This could affect some users that "expect" no validation from this handler and some new errors and failed tests may be raised for them, but I think this feature is primary concerning security and to mantain validation logic between handlers --------- Co-authored-by: Rob Cameron <[email protected]>
Related to #10724. This pull request adds password validation on resetPassword handler using the one from the signup handler.
This could affect some users that "expect" no validation from this handler and some new errors and failed tests may be raised for them, but I think this feature is primary concerning security and to mantain validation logic between handlers