mirror of
https://github.com/streetwriters/notesnook-sync-server.git
synced 2026-05-13 03:24:44 +02:00
identity: replace account already exists errors on signup with one message (#90)
This commit is contained in:
@@ -185,7 +185,14 @@ namespace Streetwriters.Identity.Services
|
||||
};
|
||||
}
|
||||
|
||||
return SignupResponse.Error(result.Errors.ToErrors());
|
||||
var otherErrors = result.Errors
|
||||
.Where(e => e.Code != "DuplicateUserName" && e.Code != "DuplicateEmail")
|
||||
.ToErrors();
|
||||
var hasDuplicate = result.Errors.Any(e => e.Code == "DuplicateUserName" || e.Code == "DuplicateEmail");
|
||||
var errors = hasDuplicate
|
||||
? ["Unable to create an account on this email.", .. otherErrors]
|
||||
: otherErrors;
|
||||
return SignupResponse.Error(errors);
|
||||
}
|
||||
catch (System.Exception ex)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user