Skip to content
Snippets Groups Projects

Fix username validation

Merged Mahdi Yari requested to merge fix-username-validator into master
2 files
+ 5
4
Compare changes
  • Side-by-side
  • Inline
Files
2
+ 4
3
@@ -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