mirror of
https://github.com/discourse/discourse.git
synced 2024-12-19 11:03:54 +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",
|
"passwordRequired",
|
||||||
"rejectedPasswords.[]",
|
"rejectedPasswords.[]",
|
||||||
"accountUsername",
|
"accountUsername",
|
||||||
|
"accountName",
|
||||||
"accountEmail",
|
"accountEmail",
|
||||||
"passwordMinLength",
|
"passwordMinLength",
|
||||||
"forceValidationReason",
|
"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 (
|
if (
|
||||||
!isEmpty(this.accountEmail) &&
|
!isEmpty(this.accountEmail) &&
|
||||||
this.accountPassword === this.accountEmail
|
this.accountPassword === this.accountEmail
|
||||||
|
|
|
@ -2044,6 +2044,7 @@ en:
|
||||||
other: "Your password is too short (minimum is %{count} characters)."
|
other: "Your password is too short (minimum is %{count} characters)."
|
||||||
common: "That password is too common."
|
common: "That password is too common."
|
||||||
same_as_username: "Your password is the same as your username."
|
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."
|
same_as_email: "Your password is the same as your email."
|
||||||
ok: "Your password looks good."
|
ok: "Your password looks good."
|
||||||
instructions:
|
instructions:
|
||||||
|
|
|
@ -749,6 +749,8 @@ en:
|
||||||
user:
|
user:
|
||||||
ip_address: ""
|
ip_address: ""
|
||||||
password: "Password"
|
password: "Password"
|
||||||
|
user_password:
|
||||||
|
password: "Password"
|
||||||
errors:
|
errors:
|
||||||
<<: *errors
|
<<: *errors
|
||||||
models:
|
models:
|
||||||
|
|
Loading…
Reference in New Issue
Block a user