public function isTokenValid($token, $user, $keySuffix)
    {
        $now = time();

        // token valid for 24 hrs (give or take, due to the coarse granularity in our strftime format string)
        for ($i = 0; $i <= 24; $i++) {
            $generatedToken = $this->generatePasswordResetToken($user, $keySuffix, $now + $i * 60 * 60);
            if ($generatedToken === $token) {
                return true;
            }
        }

        // fails if token is invalid, expired, password already changed, other user information has changed, ...
        return false;
    }
public function isTokenValid($token, $user, $keySuffix)
    {
        $now = time();

        // token valid for 24 hrs (give or take, due to the coarse granularity in our strftime format string)
        for ($i = 0; $i <= 24; $i++) {
            $generatedToken = $this->generatePasswordResetToken($user, $keySuffix, $now + $i * 60 * 60);
            if ($generatedToken === $token) {
                return true;
            }
        }

        // fails if token is invalid, expired, password already changed, other user information has changed, ...
        return false;
    }
public function isTokenValid ( $ token , $ user , $ keySuffix ) { $ now = time ( ) ; // token valid for 24 hrs (give or take, due to the coarse granularity in our strftime format string) for ( $ i = 0 ; $ i <= 24 ; $ i ++ ) { $ generatedToken = $ this -> generatePasswordResetToken ( $ user , $ keySuffix , $ now + $ i * 60 * 60 ) ; if ( $ generatedToken === $ token ) { return true ; } } // fails if token is invalid, expired, password already changed, other user information has changed, ... return false ; }
Returns true if a reset token is valid, false if otherwise. A reset token is valid if
it exists and has not expired.

@param string $token The reset token to check.
@param array $user The user information returned by the UsersManager API.
@param string $keySuffix The suffix used in generating a token.
@return bool true if valid, false otherwise.
Returns true if a reset token is valid false if otherwise . A reset token is valid if it exists and has not expired .