Advertisement
Guest User

Untitled

a guest
Jun 26th, 2019
55
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.79 KB | None | 0 0
  1. public async Task<IActionResult> OnPostConfirmationAsync(string returnUrl = null)
  2. {
  3. returnUrl = returnUrl ?? Url.Content("~/");
  4. // Get the information about the user from the external login provider
  5. var info = await _signInManager.GetExternalLoginInfoAsync();
  6. if (info == null)
  7. {
  8. ErrorMessage = "Error loading external login information during confirmation.";
  9. return RedirectToPage("./Login", new { ReturnUrl = returnUrl });
  10. }
  11.  
  12. if (ModelState.IsValid)
  13. {
  14. var user = new IdentityUser { UserName = Input.Email, Email = Input.Email };
  15. var result = await _userManager.CreateAsync(user);
  16. if (result.Succeeded)
  17. {
  18. result = await _userManager.AddLoginAsync(user, info);
  19. if (result.Succeeded)
  20. ...
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement