{"action":"opened","issue":{"url":"https://api.github.com/repos/mozilla/fxa-content-server/issues/2585","labels_url":"https://api.github.com/repos/mozilla/fxa-content-server/issues/2585/labels{/name}","comments_url":"https://api.github.com/repos/mozilla/fxa-content-server/issues/2585/comments","events_url":"https://api.github.com/repos/mozilla/fxa-content-server/issues/2585/events","html_url":"https://github.com/mozilla/fxa-content-server/issues/2585","id":87514168,"number":2585,"title":"Discussion: remove /config endpoint, instead have the options set during the build step or via the server","user":{"login":"vladikoff","id":128755,"avatar_url":"https://avatars.githubusercontent.com/u/128755?v=3","gravatar_id":"","url":"https://api.github.com/users/vladikoff","html_url":"https://github.com/vladikoff","followers_url":"https://api.github.com/users/vladikoff/followers","following_url":"https://api.github.com/users/vladikoff/following{/other_user}","gists_url":"https://api.github.com/users/vladikoff/gists{/gist_id}","starred_url":"https://api.github.com/users/vladikoff/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vladikoff/subscriptions","organizations_url":"https://api.github.com/users/vladikoff/orgs","repos_url":"https://api.github.com/users/vladikoff/repos","events_url":"https://api.github.com/users/vladikoff/events{/privacy}","received_events_url":"https://api.github.com/users/vladikoff/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/mozilla/fxa-content-server/labels/question","name":"question","color":"cc317c"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2015-06-11T21:59:44Z","updated_at":"2015-06-11T21:59:44Z","closed_at":null,"body":"Currently we call the /config endpoint on page load. \r\nThe is the data we load:\r\n\r\n```\r\nres.json({\r\n      // The `__cookies_check` cookie is set in client code\r\n      // to see if cookies are enabled. If cookies are disabled,\r\n      // the `__cookie_check` cookie will not arrive.\r\n      allowedParentOrigins: allowedParentOrigins,\r\n      authServerUrl: authServerUrl,\r\n      cookiesEnabled: !!req.cookies['__cookie_check'],\r\n      marketingEmailServerUrl: marketingEmailApiServerUrl,\r\n      marketingEmailPreferencesUrl: marketingEmailPreferencesUrl,\r\n      oAuthClientId: clientId,\r\n      oAuthUrl: oauthServerUrl,\r\n      // req.lang is set by abide in a previous middleware.\r\n      language: req.lang,\r\n      metricsSampleRate: metricsSampleRate,\r\n      profileUrl: profileServerUrl\r\n    });\r\n```\r\n\r\nInstead can we write this data into the template using the server?\r\n(If index.html has to be a static resource then the build process can write the required data into the template, see `view-source:https://oauth-stable.dev.lcip.org/console/login` ) \r\ni.e \r\n```\r\n<meta name=\"fxa-oauth-console/config/environment\" content=\"%7B%22modulePrefix%22%3A%22fxa-oauth-console%22%2C%22simple-auth%22%3A%7B%22authorizer%22%3A%22authorizer%3Acustom%22%7D%2C%22servers%22%3A%7B%22oauth%22%3A%22https%3A//oauth-stable.dev.lcip.org%22%2C%22oauthInternal%22%3A%22https%3A//oauth-stable.dev.lcip.org%22%2C%22oauthUriParsed%22%3A%7B%22protocol%22%3A%22https%3A%22%2C%22slashes%22%3Atrue%2C%22auth%22%3Anull%2C%22host%22%3A%22oauth-stable.dev.lcip.org%22%2C%22port%22%3Anull%2C%22hostname%22%3A%22oauth-stable.dev.lcip.org%22%2C%22hash%22%3Anull%2C%22search%22%3Anull%2C%22query%22%3Anull%2C%22pathname%22%3A%22/v1%22%2C%22path%22%3A%22/v1%22%2C%22href%22%3A%22https%3A//oauth-stable.dev.lcip.org/v1%22%7D%2C%22oauthInternalUriParsed%22%3A%7B%22protocol%22%3A%22https%3A%22%2C%22slashes%22%3Atrue%2C%22auth%22%3Anull%2C%22host%22%3A%22oauth-stable.dev.lcip.org%22%2C%22port%22%3Anull%2C%22hostname%22%3A%22oauth-stable.dev.lcip.org%22%2C%22hash%22%3Anull%2C%22search%22%3Anull%2C%22query%22%3Anull%2C%22pathname%22%3A%22/v1%22%2C%22path%22%3A%22/v1%22%2C%22href%22%3A%22https%3A//oauth-stable.dev.lcip.org/v1%22%7D%2C%22profileUriParsed%22%3A%7B%22protocol%22%3A%22https%3A%22%2C%22slashes%22%3Atrue%2C%22auth%22%3Anull%2C%22host%22%3A%22stable.dev.lcip.org%22%2C%22port%22%3Anull%2C%22hostname%22%3A%22stable.dev.lcip.org%22%2C%22hash%22%3Anull%2C%22search%22%3Anull%2C%22query%22%3Anull%2C%22pathname%22%3A%22/profile/v1%22%2C%22path%22%3A%22/profile/v1%22%2C%22href%22%3A%22https%3A//stable.dev.lcip.org/profile/v1%22%7D%7D%2C%22environment%22%3A%22production%22%2C%22baseURL%22%3A%22/console/%22%2C%22locationType%22%3A%22auto%22%2C%22EmberENV%22%3A%7B%22FEATURES%22%3A%7B%7D%7D%2C%22APP%22%3A%7B%7D%2C%22contentSecurityPolicyHeader%22%3A%22Content-Security-Policy-Report-Only%22%2C%22contentSecurityPolicy%22%3A%7B%22default-src%22%3A%22%27none%27%22%2C%22script-src%22%3A%22%27self%27%22%2C%22font-src%22%3A%22%27self%27%22%2C%22connect-src%22%3A%22%27self%27%22%2C%22img-src%22%3A%22%27self%27%22%2C%22style-src%22%3A%22%27self%27%22%2C%22media-src%22%3A%22%27self%27%22%7D%2C%22exportApplicationGlobal%22%3Afalse%7D\" />\r\n```\r\n\r\n\r\n@shane-tomlinson @zaach thoughts? \r\n\r\nThe sensitive config items are lang and cookie check.\r\nThis might fix issues such as https://github.com/mozilla/fxa-content-server/issues/2557 and speed up load time."}}