Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
H
hive-js
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Container Registry
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
hive
hive-js
Merge requests
!31
Fix username validation
Code
Review changes
Check out branch
Download
Patches
Plain diff
Merged
Fix username validation
fix-username-validator
into
master
Overview
1
Commits
2
Pipelines
0
Changes
2
Merged
Mahdi Yari
requested to merge
fix-username-validator
into
master
1 year ago
Overview
1
Commits
2
Pipelines
0
Changes
2
Expand
Multiple dashes in a row is VALID
0
0
Merge request reports
Compare
master
version 1
56917c4b
1 year ago
master (base)
and
latest version
latest version
d7194fce
2 commits,
1 year ago
version 1
56917c4b
1 commit,
1 year ago
2 files
+
5
−
4
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
Files
2
Search (e.g. *.vue) (Ctrl+P)
src/utils.js
+
4
−
3
Options
@@ -46,9 +46,10 @@ export function validateAccountName(value) {
if
(
!
/^
[
a-z0-9-
]
*$/
.
test
(
label
))
{
return
suffix
+
"
have only letters, digits, or dashes.
"
;
}
if
(
/--/
.
test
(
label
))
{
return
suffix
+
"
have only one dash in a row.
"
;
}
// Multiple dashes in a row is VALID
// if (/--/.test(label)) {
// return suffix + "have only one dash in a row.";
// }
if
(
!
/
[
a-z0-9
]
$/
.
test
(
label
))
{
return
suffix
+
"
end with a letter or digit.
"
;
}
Loading