src/mako/gatekeeper/entities/user/User.php
public function validatePassword(string $password, $autoSave = true): bool
	{
		$hasher = $this->getHasher();

		$isValid = $hasher->verify($password, $this->password);

		// Check if the password needs to be rehashed IF the provided password is valid

		if($isValid && $hasher->needsRehash($this->password))
		{
			$this->password = $password;

			if($autoSave)
			{
				$this->save();
			}
		}

		// Return validation result

		return $isValid;
	}
public function validatePassword(string $password, $autoSave = true): bool
	{
		$hasher = $this->getHasher();

		$isValid = $hasher->verify($password, $this->password);

		// Check if the password needs to be rehashed IF the provided password is valid

		if($isValid && $hasher->needsRehash($this->password))
		{
			$this->password = $password;

			if($autoSave)
			{
				$this->save();
			}
		}

		// Return validation result

		return $isValid;
	}
public function validatePassword ( string $ password , $ autoSave = true ) : bool { $ hasher = $ this -> getHasher ( ) ; $ isValid = $ hasher -> verify ( $ password , $ this -> password ) ; // Check if the password needs to be rehashed IF the provided password is valid if ( $ isValid && $ hasher -> needsRehash ( $ this -> password ) ) { $ this -> password = $ password ; if ( $ autoSave ) { $ this -> save ( ) ; } } // Return validation result return $ isValid ; }
Returns true if the provided password is correct and false if not.

@param  string $password Privided password
@param  bool   $autoSave Autosave rehashed password?
@return bool
Returns true if the provided password is correct and false if not .