Revamp workspace archive handling with async support, input validation improvements and better session management
CI / check (22) (push) Failing after 4m51s
CI / check (24) (push) Successful in 9m43s

This commit is contained in:
2026-10-13 18:10:56 +02:00
parent 5489e03138
commit 068843beda
16 changed files with 279 additions and 70 deletions
+15
View File
@@ -0,0 +1,15 @@
// Keep legacy printable names working, while excluding whitespace, controls,
// path separators, and URL delimiters that are unsafe/confusing in identifiers.
const USERNAME_PATTERN = /^[^\p{C}\s\\/@?#%]{3,64}$/u;
export function normalizeUsername(value) {
return String(value || "").normalize("NFKC").trim();
}
export function usernameError(username, label = "Username") {
if (!username) return `${label} is required`;
if (username.length < 3) return `${label} must be at least 3 characters`;
if (username.length > 64) return `${label} must be at most 64 characters`;
if (!USERNAME_PATTERN.test(username)) return `${label} may contain letters, numbers, dots, underscores, and hyphens only`;
return null;
}