fix: allow dots in usernames; BCrypt fallback in password verifier for v1 migrations
This commit is contained in:
@@ -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))
|
||||
|
||||
Reference in New Issue
Block a user