wip
This commit is contained in:
parent
128063165d
commit
a33c78ffe9
|
@ -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();
|
||||||
|
|
|
@ -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);
|
||||||
|
|
Loading…
Reference in New Issue