mirror of
https://github.com/streetwriters/notesnook-sync-server.git
synced 2026-09-30 18:29:36 +02:00
identity: replace account already exists errors on signup with one message (#90)
This commit is contained in:
1 parent
73750613c4
commit
d9c282fcf8
1 file changed
+8
-1
@@ -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)
|
catch (System.Exception ex)
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in new issue
Block a user