Wave Password Validation Issue: validatePassword does not exist

Solved
avinash

Nov 25th, 2022 06:25 AM

Hi Bobby,

I'm using Wave version 2.0.1 and facing the error when changing the user password from Settings >> Security page:

BadMethodCallException

Method Illuminate\Validation\Validator::validatePassword does not exist.

This exception is fired at:

wave/src/Http/Livewire/Settings/Security.php:22

Could you please help me out with this?

Thank you!

bobbyiliev

Nov 25th, 2022 07:51 AM

Best Answer

Hi there!

Thank you for reporting that problem!

It seems like that this only affects the TALL stack theme.

To fix this, make the following changes:

  • In the beginning of the file add the following facade:
use Illuminate\Support\Facades\Hash;
  • Then update the rules method from:
           'current_password' => 'required|password',

To:

            'current_password' => 'required',
  • And then right after the $this->validate(); line add the following:
if (! Hash::check($this->current_password, auth()->user()->password)) {
    return $this->dispatchBrowserEvent('popToast', ['type' => 'success', 'message' => 'Incorrect current password entered.']);
}

I'll submit a PR with a fix soon!

Let me know if you have any questions!

avinash

Nov 25th, 2022 07:08 PM

Hi Bobby,

Thank you for your quick response! I followed your instructions and got it to work.

However, I seem to have a new problem that occurs only on the DigitalOcean LEMP stack. Whenever using Chrome, attempting to log into the site using correct credentials on /login redirects me to /admin/login where no matter how many times I enter the correct credentials, it keeps reloading /admin/login without any message. If I enter incorrect credentials, it shows me an error message as it should. I tried running:

php artisan cache:clear

but that didn't help. It's happening on the /login page as well as on the /admin/login page. Clearing browser cache or a hard reload didn't help either. Closing and restarting the browser is also not helpful, so is using the Incognito mode in Chrome.

Please note that it works flawlessly in Firefox and Safari and ONLY happens on the DO server in Chrome. The local dev server works absolutely fine, without logging any error to the laravel.log.

Could you please help me out with this?

Thank you!

bobbyiliev

Nov 27th, 2022 12:57 AM

Hi there,

This is quite strange, it does not sounds like it can be related to the above change as it is not related to the login functionality.

Can you confirm:

  • That your app URL is define correctly in your .env file, it needs to match your domain exactly including the HTTP or HTTPS
  • If the app URL is set to http://your_domain.com but you are accessing your site via https://your_domain.com via chrome that would explain the odd behaviour

Let me know how it goes!

Best,

Bobby