feat(backend): global notices

This commit is contained in:
sam 2025-04-06 15:32:44 +02:00
parent 22be49976a
commit b07f4b75c0
Signed by: sam
GPG key ID: B4EF20DDE721CAA1
19 changed files with 1247 additions and 8 deletions

View file

@ -253,14 +253,14 @@ public class AuthService(
{
AssertValidAuthType(authType, app);
// This is already checked when
// This is already checked when generating an add account state, but we check it here too just in case.
int currentCount = await db
.AuthMethods.Where(m => m.UserId == userId && m.AuthType == authType)
.CountAsync(ct);
if (currentCount >= AuthUtils.MaxAuthMethodsPerType)
{
throw new ApiError.BadRequest(
"Too many linked accounts of this type, maximum of 3 per account."
$"Too many linked accounts of this type, maximum of {AuthUtils.MaxAuthMethodsPerType} per account."
);
}