This commit is contained in:
Kim 2023-09-15 16:45:00 +02:00
parent 128063165d
commit a33c78ffe9
2 changed files with 4 additions and 3 deletions

View File

@ -442,6 +442,7 @@ public class Controller : ControllerBase
: Unauthorized(); : Unauthorized();
} }
[HttpPost(nameof(ResetPasswordRequest))] [HttpPost(nameof(ResetPasswordRequest))]
public ActionResult<IEnumerable<Object>> ResetPasswordRequest(String username) public ActionResult<IEnumerable<Object>> ResetPasswordRequest(String username)
{ {
@ -458,9 +459,9 @@ public class Controller : ControllerBase
} }
[HttpGet(nameof(ResetPassword))] [HttpGet(nameof(ResetPassword))]
public ActionResult<IEnumerable<Object>> ResetPassword(Token authToken) public ActionResult<IEnumerable<Object>> ResetPassword(Token token)
{ {
var user = Db.GetSession(authToken)?.User; var user = Db.GetSession(token)?.User;
if (user is null) if (user is null)
return Unauthorized(); return Unauthorized();

View File

@ -41,7 +41,7 @@ public static class Email
Mailer.Subject("Reset the password of your Innovenergy-Account"); Mailer.Subject("Reset the password of your Innovenergy-Account");
Mailer.Body("Dear " + emailRecipientUser.Name Mailer.Body("Dear " + emailRecipientUser.Name
+ "\n To reset your password open this link:" + "\n To reset your password open this link:"
+ resetLink + "/" + resetLink + "?token="
+ token); + token);
return Mailer.SendEmailUsingSmtpConfig(config); return Mailer.SendEmailUsingSmtpConfig(config);