title: asp.net Identity ResetPassword UserId not found
body: <p>My Reset Password function has stopped working and i don't know what im done, because it was working yesterday.</p>
  
  <p>I can click on the link i get in the email an then i get to the asp.net error page</p>
  
  <p><strong>UserId not found.
  System.InvalidOperationException: UserId not found.</strong></p>
  
  <pre><code>            var manager = Context.GetOwinContext().GetUserManager&lt;ApplicationUserManager&gt;();
              ApplicationUser user = manager.FindByName(Email.Text);
  
  if (user == null || !manager.IsEmailConfirmed(user.Id))
              {
                  FailureText.Text = "Användaren existerar inte eller så är inte användarkontot bekräftat, bekräfta konto och försök sedan igen.";
                  ErrorMessage.Visible = true;
                  ConfirmAccount.Visible = true;
                  return;
              }
  
              string code = manager.GeneratePasswordResetToken(user.Id);
              string callbackUrl = IdentityHelper.GetResetPasswordRedirectUrl(code, Request);
              manager.SendEmail(user.Id, "Återställ Lösenord", "Återställ lösenord klicka &lt;a href=\"" + callbackUrl + "\"&gt;Här&lt;/a&gt;.");
  </code></pre>
  
  <p>EMail</p>
  
  <pre><code>        public Task SendAsync(IdentityMessage message)
      {
          // Plug in your email service here to send an email.
  
          try
          {
  
              MailMessage msg = new MailMessage();
              msg.From = new MailAddress("email");
              msg.To.Add(new MailAddress(message.Destination));
              msg.Subject = message.Subject;
              msg.Body = message.Body;
  
              var smtpClient = new SmtpClient();
                  smtpClient.EnableSsl = false;
  
              return smtpClient.SendMailAsync(msg);
          }
          catch (Exception ex)
          {
  
              throw ex;
          }
  
  
      }
  
  }
  </code></pre>
  
  <p>The EmailConfirmation is almost the same and its working:</p>
  
  <pre><code>        string code = manager.GenerateEmailConfirmationToken(user.Id);
          string callbackUrl = IdentityHelper.GetUserConfirmationRedirectUrl(code, user.Id, Request);
          manager.SendEmail(user.Id, "Bekräfta ditt konto",  "Bekräfta genom att klicka &lt;a href=\"" + callbackUrl + "\"&gt;Här&lt;/a&gt;.");
  </code></pre>