public function onRequestFile(&$file)
    {
        // A special case for an error state of the plugin
        if ($this->errorOccurred) {
            $file = $this->requestFile;
            return;
        }

        try {
            // Resolve a normalized version of the url
            $realUrl = ($this->requestFile) ? $this->requestUrl : $this->resolveRealUrl($file);
            
            // Authorization
            if (!in_array($realUrl, $this->alwaysAllowed, true)) {
                $this->triggerEvent('denyAccessIfRestricted', [$realUrl]);
            }
        } catch (\Exception $e) {
            $realUrl = (isset($realUrl)) ? $realUrl : "";
            $this->errorHandler($e, $realUrl);
        }
        
        if ($this->requestFile) {
            $file = $this->requestFile;
        } else {
            switch ($this->requestUrl) {
                case 'login':
                    $file = $this->pluginDir . '/content/login.md';
                    break;
                case 'logout':
                    $file = $this->pluginDir . '/content/logout.md';
                    break;
            }
        }
    }