title: How to implement correctly Reset Password at ASP.NET Core and Angular
body: <p>I'm trying to implement my password recovery to the user who entered his email.</p>
  
  <p>My problem is: I don't know how it should work exactly, I can send email successfully, but the link sent to him need to be a link to the recovery page with his token at the url I assume?</p>
  
  <p>I need to know how I involve the url with my Angular site...</p>
  
  <p>In my code I'm sending a link to the user with the link but I think its need to be after the user get to the page with the password change.</p>
  
  <p>Here's my code:</p>
  
  <pre><code>// Post Request
  // POST : /api/AppUser/Login
  #region Recover Password
  [HttpPost]
  [Route("RecoverPassword")]
  public async Task&lt;IActionResult&gt; RecoverPassword(RecoverPasswordModel model)
  {
          var user = await _userService.FindByEmail(model.Email);
          string code = await _userService.GetRecoveryToken(user);
  
          string recoveryLink = Url.Action("RecoveryLink", "AppUser", new
          {
              UserId = user.Id,
              Code = code
          }, protocol: HttpContext.Request.Scheme);
  
          bool finalRes = _userService.SendEmail(user, confirmationTokenLink);
  
          if (finalRes)
              return Ok();
          else
              return BadRequest(new { message = "No such user with this email" });
  }
  
  [HttpGet("[action]")]
  [AllowAnonymous]
  public async Task&lt;IActionResult&gt; RecoveryLink(string userId, string code, string newPassword)
  {
              if (string.IsNullOrEmpty(userId) || string.IsNullOrEmpty(code))
                  return BadRequest(new { message = "Code or ID in empty" });
  
              var user = await _userService.FindByID(userId);
  
              if (user == null)
                  return BadRequest(new { message = "User not found!" });
  
              var result = await _userService.ChangePassword(user, code, newPassword);
  
              if (result.Succeeded)
                  return Content($"&lt;html&gt;&lt;body&gt;&lt;h1&gt;Your Password changed successfully!!! &lt;/h1&gt;&lt;hr&gt;&lt;a href= { EMAIL_VERIFIED_URI }&gt; Please Login now! &lt;/a&gt;&lt;/body&gt;&lt;/html&gt;", "text/html");
              else
                  return BadRequest(new { message = "Reset failed!" });
  
  }
  </code></pre>