async function getApp(req, res) {
  const { config } = req;

  const currentUser =
    req.isAuthenticated() && req.user
      ? {
          id: req.user.id,
          email: req.user.email,
          role: req.user.role,
          name: req.user.name,
          ldapId: req.user.ldapId,
        }
      : undefined;

  return res.utils.data({
    currentUser,
    config: {
      allowCsvDownload: config.get('allowCsvDownload'),
      baseUrl: config.get('baseUrl'),
      defaultConnectionId: config.get('defaultConnectionId'),
      editorWordWrap: config.get('editorWordWrap'),
      googleAuthConfigured: Boolean(config.googleAuthConfigured()),
      localAuthConfigured: !config.get('userpassAuthDisabled'),
      publicUrl: config.get('publicUrl'),
      samlConfigured: Boolean(config.get('samlEntryPoint')),
      samlLinkHtml: config.get('samlLinkHtml'),
      ldapConfigured: config.get('ldapAuthEnabled'),
      ldapRolesConfigured: Boolean(
        config.get('ldapRoleAdminFilter') || config.get('ldapRoleEditorFilter')
      ),
      oidcConfigured: config.oidcConfigured(),
      oidcLinkHtml: config.get('oidcLinkHtml'),
      showServiceTokensUI: Boolean(config.get('serviceTokenSecret')),
    },
    version: packageJson.version,
  });
}
@param {Req} req
@param {Res} res