feat(frontend): register/log in with email
This commit is contained in:
parent
57e1ec09c0
commit
bc7fd6d804
19 changed files with 598 additions and 380 deletions
|
@ -185,6 +185,27 @@ public static partial class ValidationUtils
|
|||
};
|
||||
}
|
||||
|
||||
public const int MinimumPasswordLength = 12;
|
||||
public const int MaximumPasswordLength = 1024;
|
||||
|
||||
public static ValidationError? ValidatePassword(string password) =>
|
||||
password.Length switch
|
||||
{
|
||||
< MinimumPasswordLength => ValidationError.LengthError(
|
||||
"Password is too short",
|
||||
MinimumPasswordLength,
|
||||
MaximumPasswordLength,
|
||||
password.Length
|
||||
),
|
||||
> MaximumPasswordLength => ValidationError.LengthError(
|
||||
"Password is too long",
|
||||
MinimumPasswordLength,
|
||||
MaximumPasswordLength,
|
||||
password.Length
|
||||
),
|
||||
_ => null,
|
||||
};
|
||||
|
||||
[GeneratedRegex(@"^[a-zA-Z_0-9\-\.]{2,40}$", RegexOptions.IgnoreCase, "en-NL")]
|
||||
private static partial Regex UsernameRegex();
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue