Make sure to log errors when failing to send emails (#6754)
Этот коммит содержится в:
коммит произвёл
GitHub
родитель
28e0b8dc27
Коммит
7bde11d21b
@@ -1016,10 +1016,10 @@ func sendVerificationEmail(c *Context, w http.ResponseWriter, r *http.Request) {
|
||||
return
|
||||
}
|
||||
|
||||
app.SendEmailVerification(user)
|
||||
err = app.SendEmailVerification(user)
|
||||
if err != nil {
|
||||
// Don't want to leak whether the email is valid or not
|
||||
l4g.Error("Unable to create email verification token: " + err.Error())
|
||||
l4g.Error(err.Error())
|
||||
ReturnStatusOK(w)
|
||||
return
|
||||
}
|
||||
|
||||
@@ -1287,12 +1287,10 @@ func SendEmailVerification(user *model.User) *model.AppError {
|
||||
}
|
||||
|
||||
if _, err := GetStatus(user.Id); err != nil {
|
||||
go SendVerifyEmail(user.Email, user.Locale, utils.GetSiteURL(), token.Token)
|
||||
return SendVerifyEmail(user.Email, user.Locale, utils.GetSiteURL(), token.Token)
|
||||
} else {
|
||||
go SendEmailChangeVerifyEmail(user.Email, user.Locale, utils.GetSiteURL(), token.Token)
|
||||
return SendEmailChangeVerifyEmail(user.Email, user.Locale, utils.GetSiteURL(), token.Token)
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
func VerifyEmailFromToken(userSuppliedTokenString string) *model.AppError {
|
||||
|
||||
Ссылка в новой задаче
Block a user