You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
try
{
if (User.Identity.IsAuthenticated)
{
return RedirectToAction("Manage");
}
if (ModelState.IsValid)
{
// Get the information about the user from the external login provider
var info = await AuthenticationManager.GetExternalLoginInfoAsync();
if (info == null)
{
return View("ExternalLoginFailure");
}
var user = new ApplicationUser() { UserName = model.LoginVK, Email = model.Email };
var result = await UserManager.CreateAsync(user);
if (result.Succeeded)
{
result = await UserManager.AddLoginAsync(user.Id, info.Login);
if (result.Succeeded)
{
await SignInManager.SignInAsync(user, isPersistent: false, rememberBrowser: false);
return RedirectToLocal(returnUrl);
}
}
AddErrors(result);
}
ViewBag.ReturnUrl = returnUrl;
return View(model);
}
}
...
`
When I click "Войти", I have the error:
Email 'ds......@mail.ua' is already taken
Where my mistake?
The text was updated successfully, but these errors were encountered:
Hi, thise my code:
View:
`
....
@Html.TextBoxFor(m => m.LoginVK, new { @Class = "form-control" })
@Html.ValidationMessageFor(m => m.LoginVK, "", new { @Class = "text-danger" })
....
Controller:
...
[HttpPost]
[AllowAnonymous]
[ValidateAntiForgeryToken]
public async Task ExternalLoginConfirmation(ExternalLoginConfirmationViewModel model, string returnUrl)
{
}
...
`
When I click "Войти", I have the error:
Email 'ds......@mail.ua' is already taken
Where my mistake?
The text was updated successfully, but these errors were encountered: