summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRémy Coutable <remy@rymai.me>2018-06-13 10:42:40 +0000
committerRémy Coutable <remy@rymai.me>2018-06-13 10:42:40 +0000
commitf23dbfd6c6f4d72403bef8a251be014abd80ca69 (patch)
tree775bec75d05cb91804cd0c686a8a81d94af5955f
parent115ab79b702ea19aec45c884e3b0caa95ca02e88 (diff)
parent5e2b8ab8d7d80f91a6d1e1951041defcd431b841 (diff)
downloadgitlab-ce-f23dbfd6c6f4d72403bef8a251be014abd80ca69.tar.gz
Merge branch '45575-invalid-characters-signup' into 'master'
Resolve "Bug: When creating an account with invalid characters the error is "Username already taken" not "Invalid characters used"" Closes #45575 See merge request gitlab-org/gitlab-ce!19610
-rw-r--r--app/assets/javascripts/pages/sessions/new/username_validator.js9
-rw-r--r--changelogs/unreleased/45575-invalid-characters-signup.yml5
2 files changed, 9 insertions, 5 deletions
diff --git a/app/assets/javascripts/pages/sessions/new/username_validator.js b/app/assets/javascripts/pages/sessions/new/username_validator.js
index 825de01b5a2..87213c94eda 100644
--- a/app/assets/javascripts/pages/sessions/new/username_validator.js
+++ b/app/assets/javascripts/pages/sessions/new/username_validator.js
@@ -62,13 +62,13 @@ export default class UsernameValidator {
return this.setPendingState();
}
- if (!this.state.available) {
- return this.setUnavailableState();
- }
-
if (!this.state.valid) {
return this.setInvalidState();
}
+
+ if (!this.state.available) {
+ return this.setUnavailableState();
+ }
}
interceptInvalid(event) {
@@ -89,7 +89,6 @@ export default class UsernameValidator {
setAvailabilityState(usernameTaken) {
if (usernameTaken) {
- this.state.valid = false;
this.state.available = false;
} else {
this.state.available = true;
diff --git a/changelogs/unreleased/45575-invalid-characters-signup.yml b/changelogs/unreleased/45575-invalid-characters-signup.yml
new file mode 100644
index 00000000000..679bd13e59b
--- /dev/null
+++ b/changelogs/unreleased/45575-invalid-characters-signup.yml
@@ -0,0 +1,5 @@
+---
+title: 'Fix username validation order on signup, resolves #45575'
+merge_request: 19610
+author: Jan Beckmann
+type: fixed