mirror of
https://github.com/discourse/discourse.git
synced 2024-12-19 07:53:47 +08:00
FIX: Improve name validation in the signup form (#30150)
This commit is contained in:
parent
f0ea57e30e
commit
ca0ea3d201
|
@ -30,6 +30,7 @@ export default Mixin.create({
|
|||
"passwordRequired",
|
||||
"rejectedPasswords.[]",
|
||||
"accountUsername",
|
||||
"accountName",
|
||||
"accountEmail",
|
||||
"passwordMinLength",
|
||||
"forceValidationReason",
|
||||
|
@ -88,6 +89,17 @@ export default Mixin.create({
|
|||
);
|
||||
}
|
||||
|
||||
if (
|
||||
!isEmpty(this.accountName) &&
|
||||
this.accountPassword === this.accountName
|
||||
) {
|
||||
return EmberObject.create(
|
||||
Object.assign(failedAttrs, {
|
||||
reason: i18n("user.password.same_as_name"),
|
||||
})
|
||||
);
|
||||
}
|
||||
|
||||
if (
|
||||
!isEmpty(this.accountEmail) &&
|
||||
this.accountPassword === this.accountEmail
|
||||
|
|
|
@ -2044,6 +2044,7 @@ en:
|
|||
other: "Your password is too short (minimum is %{count} characters)."
|
||||
common: "That password is too common."
|
||||
same_as_username: "Your password is the same as your username."
|
||||
same_as_name: "Your password is the same as your name."
|
||||
same_as_email: "Your password is the same as your email."
|
||||
ok: "Your password looks good."
|
||||
instructions:
|
||||
|
|
|
@ -749,6 +749,8 @@ en:
|
|||
user:
|
||||
ip_address: ""
|
||||
password: "Password"
|
||||
user_password:
|
||||
password: "Password"
|
||||
errors:
|
||||
<<: *errors
|
||||
models:
|
||||
|
|
Loading…
Reference in New Issue
Block a user