Chore: Add user service method ChangePassword (#53303)

* Chore: Add user service method ChangePassword

* Fix lint
This commit is contained in:
idafurjes
2022-08-04 15:05:05 +02:00
committed by GitHub
parent 6fdb6ea6f6
commit 20f4191e56
10 changed files with 34 additions and 17 deletions
+3 -3
View File
@@ -121,12 +121,12 @@ func (hs *HTTPServer) AdminUpdateUserPassword(c *models.ReqContext) response.Res
return response.Error(500, "Could not encode password", err)
}
cmd := models.ChangeUserPasswordCommand{
UserId: userID,
cmd := user.ChangeUserPasswordCommand{
UserID: userID,
NewPassword: passwordHashed,
}
if err := hs.SQLStore.ChangeUserPassword(c.Req.Context(), &cmd); err != nil {
if err := hs.userService.ChangePassword(c.Req.Context(), &cmd); err != nil {
return response.Error(500, "Failed to update user password", err)
}