diff --git a/src/backends/github/AuthenticationPage.js b/src/backends/github/AuthenticationPage.js index f9e0f2c7..b3d62588 100644 --- a/src/backends/github/AuthenticationPage.js +++ b/src/backends/github/AuthenticationPage.js @@ -13,12 +13,11 @@ export default class AuthenticationPage extends React.Component { handleLogin = (e) => { e.preventDefault(); - let auth; - if (document.location.host.split(':')[0] === 'localhost') { - auth = new Authenticator({ site_id: 'cms.netlify.com' }); - } else { - auth = new Authenticator({ site_id: this.props.siteId }); + const cfg = { + base_url: this.props.base_url, + site_id: (document.location.host.split(':')[0] === 'localhost') ? 'cms.netlify.com' : this.props.siteId } + const auth = new Authenticator(cfg); auth.authenticate({ provider: 'github', scope: 'repo' }, (err, data) => { if (err) { diff --git a/src/containers/App.js b/src/containers/App.js index 0b6cfed8..6f4d62f9 100644 --- a/src/containers/App.js +++ b/src/containers/App.js @@ -89,6 +89,7 @@ class App extends React.Component { error: auth && auth.get('error'), isFetching: auth && auth.get('isFetching'), siteId: this.props.config.getIn(["backend", "site_domain"]), + base_url: this.props.config.getIn(["backend", "base_url"], null) }) }