fix
This commit is contained in:
parent
2019bce30e
commit
63937ea358
@ -1,3 +1,5 @@
|
|||||||
|
Subject: Password Reset Request for Your {{ .CompanyName }} Account
|
||||||
|
|
||||||
Dear {{ .UserName }},
|
Dear {{ .UserName }},
|
||||||
|
|
||||||
We have received your request to reset the password for your {{ .CompanyName }} account.
|
We have received your request to reset the password for your {{ .CompanyName }} account.
|
||||||
|
@ -53,7 +53,7 @@ func RegisterHandlers(server *rest.Server, serverCtx *svc.ServiceContext) {
|
|||||||
Handler: UserResetPasswordHandler(serverCtx),
|
Handler: UserResetPasswordHandler(serverCtx),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
Method: http.MethodPost,
|
Method: http.MethodGet,
|
||||||
Path: "/api/auth/reset/password/html",
|
Path: "/api/auth/reset/password/html",
|
||||||
Handler: UserResetPasswordHtmlHandler(serverCtx),
|
Handler: UserResetPasswordHtmlHandler(serverCtx),
|
||||||
},
|
},
|
||||||
|
@ -179,7 +179,6 @@ func (m *EmailSender) Resend(uniqueKey string, content []byte) {
|
|||||||
|
|
||||||
m.lock.Lock()
|
m.lock.Lock()
|
||||||
defer m.lock.Unlock()
|
defer m.lock.Unlock()
|
||||||
|
|
||||||
// Check if the email task still exists and has not been sent successfully
|
// 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()) {
|
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)
|
err := smtp.SendMail(task.Email.TargetEmail, m.Auth, m.FromEmail, []string{task.Email.TargetEmail}, content)
|
||||||
|
@ -37,7 +37,7 @@ type DataResetToken struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
type RequestUserResetHtml struct {
|
type RequestUserResetHtml struct {
|
||||||
ResetToken string `json:"reset_token"`
|
ResetToken string `form:"reset_token"`
|
||||||
}
|
}
|
||||||
|
|
||||||
type RequestUserResetPassword struct {
|
type RequestUserResetPassword struct {
|
||||||
|
@ -38,7 +38,7 @@ service auth {
|
|||||||
|
|
||||||
// 获取重定向到html页面
|
// 获取重定向到html页面
|
||||||
@handler UserResetPasswordHtmlHandler
|
@handler UserResetPasswordHtmlHandler
|
||||||
post /api/auth/reset/password/html(RequestUserResetHtml) returns (response);
|
get /api/auth/reset/password/html(RequestUserResetHtml) returns (response);
|
||||||
|
|
||||||
@handler DebugAuthDeleteHandler
|
@handler DebugAuthDeleteHandler
|
||||||
post /api/auth/debug/delete(RequestAuthDelete) returns (response);
|
post /api/auth/debug/delete(RequestAuthDelete) returns (response);
|
||||||
@ -96,7 +96,7 @@ type (
|
|||||||
|
|
||||||
// RequestUserResetPassword 重置密码
|
// RequestUserResetPassword 重置密码
|
||||||
RequestUserResetHtml {
|
RequestUserResetHtml {
|
||||||
ResetToken string `json:"reset_token"`
|
ResetToken string `form:"reset_token"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// RequestUserResetPassword 重置密码
|
// RequestUserResetPassword 重置密码
|
||||||
|
Loading…
x
Reference in New Issue
Block a user