backend + web: Improve validation and email retry handling
This commit is contained in:
1 parent
e9782a1413
commit
722d318898
13 files changed
+195
-44
No files matched your search
@@ -29,7 +29,7 @@ public sealed class AuthService(
|
||||
await registerValidator.ValidateAndThrowAsync(request, ct);
|
||||
|
||||
var role = _registration.ResolveRole(request.Email)
|
||||
?? throw new BadRequestException("Registrace je možná jen s univerzitním e-mailem.");
|
||||
?? throw new FieldValidationException(nameof(request.Email), "Registrace je možná jen s univerzitním e-mailem.");
|
||||
|
||||
var normalized = User.NormalizeEmail(request.Email);
|
||||
var user = await db.Users.SingleOrDefaultAsync(u => u.EmailNormalized == normalized, ct);
|
||||
|
||||
Reference in new issue
Block a user