This commit is contained in:
eson
2023-09-05 15:44:17 +08:00
parent 2019bce30e
commit 63937ea358
5 changed files with 6 additions and 5 deletions

View File

@@ -53,7 +53,7 @@ func RegisterHandlers(server *rest.Server, serverCtx *svc.ServiceContext) {
Handler: UserResetPasswordHandler(serverCtx),
},
{
Method: http.MethodPost,
Method: http.MethodGet,
Path: "/api/auth/reset/password/html",
Handler: UserResetPasswordHtmlHandler(serverCtx),
},

View File

@@ -179,7 +179,6 @@ func (m *EmailSender) Resend(uniqueKey string, content []byte) {
m.lock.Lock()
defer m.lock.Unlock()
// Check if the email task still exists and has not been sent successfully
if task, ok := m.emailSending[uniqueKey]; ok && task.SendTime.Add(m.ResendTimeLimit).After(time.Now().UTC()) {
err := smtp.SendMail(task.Email.TargetEmail, m.Auth, m.FromEmail, []string{task.Email.TargetEmail}, content)

View File

@@ -37,7 +37,7 @@ type DataResetToken struct {
}
type RequestUserResetHtml struct {
ResetToken string `json:"reset_token"`
ResetToken string `form:"reset_token"`
}
type RequestUserResetPassword struct {