goToPage(req, page, params = {}, responseType) {
    const config = req.config;

    // Determine redirect either by force, response setting or request method
    const redirect = config.pages.forceRedirect
      ? true
      : responseType !== undefined
        ? responseType
        : req.method == 'POST';

    // Include default parameters
    const defaultParams = this.getDefaultParams(config);
    if (Object.values(defaultParams).includes(undefined)) {
      return this.notFound();
    }
    params = Object.assign(params, defaultParams);

    // Add locale to params to ensure it is passed on with every request;
    // that means, once a locale is set, it is passed on to any follow-up page,
    // e.g. request_password_reset -> password_reset -> password_reset_success
    const locale = this.getLocale(req);
    params[pageParams.locale] = locale;

    // Compose paths and URLs
    const defaultFile = page.defaultFile;
    const defaultPath = this.defaultPagePath(defaultFile);
    const defaultUrl = this.composePageUrl(defaultFile, config.publicServerURL);

    // If custom URL is set redirect to it without localization
    const customUrl = config.pages.customUrls[page.id];
    if (customUrl && !Utils.isPath(customUrl)) {
      return this.redirectResponse(customUrl, params);
    }

    // Get JSON placeholders
    let placeholders = {};
    if (config.pages.enableLocalization && config.pages.localizationJsonPath) {
      placeholders = this.getJsonPlaceholders(locale, params);
    }

    // Send response
    if (config.pages.enableLocalization && locale) {
      return Utils.getLocalizedPath(defaultPath, locale).then(({ path, subdir }) =>
        redirect
          ? this.redirectResponse(
            this.composePageUrl(defaultFile, config.publicServerURL, subdir),
            params
          )
          : this.pageResponse(path, params, placeholders)
      );
    } else {
      return redirect
        ? this.redirectResponse(defaultUrl, params)
        : this.pageResponse(defaultPath, params, placeholders);
    }
  }
Returns page content if the page is a local file or returns a
redirect to a custom page.
@param {Object} req The express request.
@param {Page} page The page to go to.
@param {Object} [params={}] The query parameters to attach to the URL in case of
HTTP redirect responses for POST requests, or the placeholders to fill into
the response content in case of HTTP content responses for GET requests.
@param {Boolean} [responseType] Is true if a redirect response should be forced,
false if a content response should be forced, undefined if the response type
should depend on the request type by default:
- GET request -> content response
- POST request -> redirect response (PRG pattern)
@returns {Promise<Object>} The PromiseRouter response.