chore(backend): format

This commit is contained in:
sam 2024-10-01 21:58:13 +02:00
parent 42041d49bc
commit aa756ac56a
Signed by: sam
GPG key ID: B4EF20DDE721CAA1
3 changed files with 4 additions and 2 deletions

View file

@ -125,7 +125,7 @@ public class EmailAuthController(
private void CheckRequirements() private void CheckRequirements()
{ {
if (!config.DiscordAuth.Enabled) if (!config.EmailAuth.Enabled)
throw new ApiError.BadRequest("Email authentication is not enabled on this instance."); throw new ApiError.BadRequest("Email authentication is not enabled on this instance.");
} }

View file

@ -186,7 +186,8 @@ public class UsersController(
if (preferences.Count > MaxCustomPreferences) if (preferences.Count > MaxCustomPreferences)
errors.Add(("custom_preferences", errors.Add(("custom_preferences",
ValidationError.LengthError("Too many custom preferences", 0, MaxCustomPreferences, preferences.Count))); ValidationError.LengthError("Too many custom preferences", 0, MaxCustomPreferences,
preferences.Count)));
if (preferences.Count > 50) return errors; if (preferences.Count > 50) return errors;
// TODO: validate individual preferences // TODO: validate individual preferences

View file

@ -289,6 +289,7 @@ public static partial class ValidationUtils
[GeneratedRegex(@"^[a-zA-Z_0-9\-\.]{2,40}$", RegexOptions.IgnoreCase, "en-NL")] [GeneratedRegex(@"^[a-zA-Z_0-9\-\.]{2,40}$", RegexOptions.IgnoreCase, "en-NL")]
private static partial Regex UsernameRegex(); private static partial Regex UsernameRegex();
[GeneratedRegex("""^[^@'$%&()+<=>^|~`,*!#/\\\[\]""\{\}\?]{1,100}$""", RegexOptions.IgnoreCase, "en-NL")] [GeneratedRegex("""^[^@'$%&()+<=>^|~`,*!#/\\\[\]""\{\}\?]{1,100}$""", RegexOptions.IgnoreCase, "en-NL")]
private static partial Regex MemberRegex(); private static partial Regex MemberRegex();
} }