Allow periods in usernames

Update username validation regex to allow periods (.) in addition to alphanumeric characters and dashes. Usernames must still start and end with alphanumeric characters.
This commit is contained in:
2025-12-13 18:24:16 +01:00
parent f53d3024c7
commit 7246d4c723

View File

@@ -14,7 +14,7 @@ ed25519.hashes.sha512Async = async (message: Uint8Array) => {
}; };
// Username validation // Username validation
const USERNAME_REGEX = /^[a-z0-9][a-z0-9-]*[a-z0-9]$/; const USERNAME_REGEX = /^[a-z0-9][a-z0-9.-]*[a-z0-9]$/;
const USERNAME_MIN_LENGTH = 3; const USERNAME_MIN_LENGTH = 3;
const USERNAME_MAX_LENGTH = 32; const USERNAME_MAX_LENGTH = 32;