set username on email change

closes #673
This commit is contained in:
Kukks
2019-03-22 12:52:38 +01:00
parent be90172840
commit 1281f348bf

View File

@@ -111,6 +111,7 @@ namespace BTCPayServer.Controllers
var setEmailResult = await _userManager.SetEmailAsync(user, model.Email);
if (!setEmailResult.Succeeded)
{
await _userManager.SetUserNameAsync(user, model.Username);
throw new ApplicationException($"Unexpected error occurred setting email for user with ID '{user.Id}'.");
}
}