Chore: Remove result field from notifications (#65170)
* remove result field from notifications * fix test
This commit is contained in:
+4
-4
@@ -70,7 +70,8 @@ func (hs *HTTPServer) ResetPassword(c *contextmodel.ReqContext) response.Respons
|
||||
return usr, err
|
||||
}
|
||||
|
||||
if err := hs.NotificationService.ValidateResetPasswordCode(c.Req.Context(), &query, getUserByLogin); err != nil {
|
||||
userResult, err := hs.NotificationService.ValidateResetPasswordCode(c.Req.Context(), &query, getUserByLogin)
|
||||
if err != nil {
|
||||
if errors.Is(err, notifications.ErrInvalidEmailCode) {
|
||||
return response.Error(400, "Invalid or expired reset password code", nil)
|
||||
}
|
||||
@@ -87,9 +88,8 @@ func (hs *HTTPServer) ResetPassword(c *contextmodel.ReqContext) response.Respons
|
||||
}
|
||||
|
||||
cmd := user.ChangeUserPasswordCommand{}
|
||||
cmd.UserID = query.Result.ID
|
||||
var err error
|
||||
cmd.NewPassword, err = util.EncodePassword(form.NewPassword, query.Result.Salt)
|
||||
cmd.UserID = userResult.ID
|
||||
cmd.NewPassword, err = util.EncodePassword(form.NewPassword, userResult.Salt)
|
||||
if err != nil {
|
||||
return response.Error(500, "Failed to encode password", err)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user