title: Asp.net core identity change username/email
body: <p>The default identity change username/email with confirmation logic doesn't make sense.</p>
  
  <ul>
  <li>Set app with require email confirmation.</li>
  <li>Set require confirmed email to sign in.</li>
  <li>User then changes email, enters email incorrectly, logs out.</li>
  <li>Now the user is locked out. Email has changed but requires
  confirmation to sign in and no email confirmation link because
  address entered incorrectly.</li>
  </ul>
  
  <p>Have I setup my application wrong or did Microsoft not design Identity very well? </p>
  
  <pre><code>  public async Task&lt;IActionResult&gt; OnPostAsync()
          {
              if (!ModelState.IsValid)
              {
                  return Page();
              }
  
              var user = await _userManager.GetUserAsync(User);
              if (user == null)
              {
                  return NotFound($"Unable to load user with ID '{_userManager.GetUserId(User)}'.");
              }
  
     //...
  
        var email = await _userManager.GetEmailAsync(user);
              if (Input.Email != email)
              {
                  var setEmailResult = await _userManager.SetEmailAsync(user, Input.Email);
                  if (!setEmailResult.Succeeded)
                  {
                      var userId = await _userManager.GetUserIdAsync(user);
                      throw new InvalidOperationException($"Unexpected error occurred setting email for user with ID '{userId}'.");
                  }
                  StatusMessage = "&lt;strong&gt;Verify your new email&lt;/strong&gt;&lt;br/&gt;&lt;br/&gt;" +
                      "We sent an email to " + Input.Email +
                      " to verify your address. Please click the link in that email to continue.";
              }
  
    //...
  
  
          await _signInManager.RefreshSignInAsync(user);
  
          return RedirectToPage();
      }
  </code></pre>