Include password token entity ID in reset URL in order to prevent loading all tokens.
This commit is contained in:
parent
5c64cd6191
commit
f4c98ba523
7 changed files with 50 additions and 35 deletions
|
|
@ -76,7 +76,7 @@ func (c *ForgotPassword) Post(ctx echo.Context) error {
|
|||
}
|
||||
|
||||
// Generate the token
|
||||
token, _, err := c.Container.Auth.GeneratePasswordResetToken(ctx, u.ID)
|
||||
token, pt, err := c.Container.Auth.GeneratePasswordResetToken(ctx, u.ID)
|
||||
if err != nil {
|
||||
return c.Fail(ctx, err, "error generating password reset token")
|
||||
}
|
||||
|
|
@ -84,7 +84,7 @@ func (c *ForgotPassword) Post(ctx echo.Context) error {
|
|||
ctx.Logger().Infof("generated password reset token for user %d", u.ID)
|
||||
|
||||
// Email the user
|
||||
url := ctx.Echo().Reverse("reset_password", u.ID, token)
|
||||
url := ctx.Echo().Reverse("reset_password", u.ID, pt.ID, token)
|
||||
err = c.Container.Mail.
|
||||
Compose().
|
||||
To(u.Email).
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue