Piwik\API\Request::shouldReloadAuthUsingTokenAuth PHP Method

shouldReloadAuthUsingTokenAuth() private static method

private static shouldReloadAuthUsingTokenAuth ( $request )
    private static function shouldReloadAuthUsingTokenAuth($request)
    {
        if (is_null($request)) {
            $request = self::getDefaultRequest();
        }
        if (!isset($request['token_auth'])) {
            // no token is given so we just keep the current loaded user
            return false;
        }
        // a token is specified, we need to reload auth in case it is different than the current one, even if it is empty
        $tokenAuth = Common::getRequestVar('token_auth', '', 'string', $request);
        // not using !== is on purpose as getTokenAuth() might return null whereas $tokenAuth is '' . In this case
        // we do not need to reload.
        return $tokenAuth != Access::getInstance()->getTokenAuth();
    }