public IActionResult ResetPassword(Login login) { try { User user = Authentification.UserLink(login.Username); string token = JwtGenerator.GenerateJSONWebToken(user.Id); Response.Headers.Add("Token", token); Uri domain = new Uri(Request.GetDisplayUrl()); Uri uri = new Uri(domain.Scheme + "://" + domain.Host + (domain.IsDefaultPort ? "" : ":" + domain.Port)); string url = uri.ToString(); EmailManager.SendEmail(user, token, url); return(Ok()); } catch { return(BadRequest()); } }