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

View File

@@ -52,12 +52,12 @@ func resetPasswordCommand(c utils.CommandLine, runner runner.Runner) error {
return err
}
cmd := models.ChangeUserPasswordCommand{
UserId: AdminUserId,
cmd := user.ChangeUserPasswordCommand{
UserID: AdminUserId,
NewPassword: passwordHashed,
}
if err := runner.SQLStore.ChangeUserPassword(context.Background(), &cmd); err != nil {
if err := runner.UserService.ChangePassword(context.Background(), &cmd); err != nil {
return fmt.Errorf("failed to update user password: %w", err)
}