public function authenticate($passwordProvided, $passwordHash)
    {
        if (password_verify($passwordProvided, $passwordHash)) {
            $this->setAuthenticated(true);

            if ($this->getUser() && property_exists($this->getUser(), $this->getUserIdProperty())) {
                $userId = $this->getUser()->{$this->getUserIdProperty()};
                $this->setAuthenticationData(['user_id' => $userId]);
            }
            $this->writeToSession([
                'authenticated' => true,
                'data'          => $this->getAuthenticationData(),
            ]);
        } else {
            $this->revokeAuthentication();
        }
        return $this->isAuthenticated();
    }
public function authenticate($passwordProvided, $passwordHash)
    {
        if (password_verify($passwordProvided, $passwordHash)) {
            $this->setAuthenticated(true);

            if ($this->getUser() && property_exists($this->getUser(), $this->getUserIdProperty())) {
                $userId = $this->getUser()->{$this->getUserIdProperty()};
                $this->setAuthenticationData(['user_id' => $userId]);
            }
            $this->writeToSession([
                'authenticated' => true,
                'data'          => $this->getAuthenticationData(),
            ]);
        } else {
            $this->revokeAuthentication();
        }
        return $this->isAuthenticated();
    }
public function authenticate ( $ passwordProvided , $ passwordHash ) { if ( password_verify ( $ passwordProvided , $ passwordHash ) ) { $ this -> setAuthenticated ( true ) ; if ( $ this -> getUser ( ) && property_exists ( $ this -> getUser ( ) , $ this -> getUserIdProperty ( ) ) ) { $ userId = $ this -> getUser ( ) -> { $ this -> getUserIdProperty ( ) } ; $ this -> setAuthenticationData ( [ 'user_id' => $ userId ] ) ; } $ this -> writeToSession ( [ 'authenticated' => true , 'data' => $ this -> getAuthenticationData ( ) , ] ) ; } else { $ this -> revokeAuthentication ( ) ; } return $ this -> isAuthenticated ( ) ; }
Check whether the provided password matches the password hash.

@param string $passwordProvided
@param string $passwordHash

@return bool
Check whether the provided password matches the password hash .