fix: allow dots in usernames; BCrypt fallback in password verifier for v1 migrations

This commit is contained in:
2026-05-15 02:56:18 +02:00
parent 555bcea307
commit f7350847c5
3 changed files with 10 additions and 2 deletions

View File

@@ -44,9 +44,12 @@ impl Username {
if s.is_empty() || s.len() > 32 {
return Err(DomainError::InvalidInput("username: 1-32 chars".into()));
}
if !s.chars().all(|c| c.is_alphanumeric() || c == '_') {
if !s
.chars()
.all(|c| c.is_alphanumeric() || c == '_' || c == '.')
{
return Err(DomainError::InvalidInput(
"username: alphanumeric or underscore only".into(),
"username: alphanumeric, underscore, or dot only".into(),
));
}
Ok(Self(s))