fix
This commit is contained in:
@@ -66,11 +66,11 @@ func (l *UserResetPasswordLogic) UserResetPassword(req *types.RequestUserResetPa
|
||||
return fmt.Errorf("password had been reset")
|
||||
}
|
||||
|
||||
if *user.PasswordHash == rt.NewPassword {
|
||||
if *user.PasswordHash == req.NewPassword {
|
||||
return fmt.Errorf("the password is the same as the old one. It needs to be changed")
|
||||
}
|
||||
|
||||
return tx.Where("id = ?", rt.UserId).Update("PasswordHash", rt.NewPassword).Error
|
||||
return tx.Where("id = ?", rt.UserId).Update("PasswordHash", req.NewPassword).Error
|
||||
})
|
||||
|
||||
if err != nil {
|
||||
|
||||
Reference in New Issue
Block a user