add correct error reporting for blank password (#7391)

* add correct error reporting for blank password

* fix prettier

---------

Co-authored-by: zuccs <daniel@zuccon.com>
This commit is contained in:
Samuel Newman
2025-01-13 17:43:18 +00:00
committed by GitHub
parent d7f5ee8415
commit 82881d1410
+8 -2
View File
@@ -41,8 +41,8 @@ export const SetNewPasswordForm = ({
// Check that the code is correct. We do this again just incase the user enters the code after their pw and we
// don't get to call onBlur first
const formattedCode = checkAndFormatResetCode(resetCode)
// TODO Better password strength check
if (!formattedCode || !password) {
if (!formattedCode) {
setError(
_(
msg`You have entered an invalid code. It should look like XXXXX-XXXXX.`,
@@ -51,6 +51,12 @@ export const SetNewPasswordForm = ({
return
}
// TODO Better password strength check
if (!password) {
setError(_(msg`Please enter a password.`))
return
}
setError('')
setIsProcessing(true)