feat: remove username length limit

This commit is contained in:
Lin, Hung-Shin committed 2023-11-02 11:36:53 +08:00
1 parent b09aa0debf
commit a5896e7c15
4 files changed
+11 -14

No files matched your search

+5 -5
View File
@@ -1,15 +1,15 @@
export function isValidUsername(username) {
// check if the username is between 1 and 32 characters
if (username.length > 32) {
return false
}
// Define a regular expression pattern for a valid Linux username.
const usernamePattern = /^[a-z][a-z0-9_-]*$/
// Test the username against the pattern.
if (!usernamePattern.test(username)) return false
// check if the username is between 1 and 32 characters
if (username.length < 4 || username.length > 32) {
return false
}
const reservedWords = [
'root',
'admin',