Add backend config for site ID
Users can now specify `site_domain` in `config.yml`. This is useful when attempting to access the CMS from a different host.
This commit is contained in:
@ -17,7 +17,7 @@ export default class AuthenticationPage extends React.Component {
|
||||
if (document.location.host.split(':')[0] === 'localhost') {
|
||||
auth = new Authenticator({ site_id: 'cms.netlify.com' });
|
||||
} else {
|
||||
auth = new Authenticator();
|
||||
auth = new Authenticator({ site_id: this.props.siteId });
|
||||
}
|
||||
|
||||
auth.authenticate({ provider: 'github', scope: 'repo' }, (err, data) => {
|
||||
|
@ -51,6 +51,7 @@ class App extends React.Component {
|
||||
runCommand: PropTypes.func.isRequired,
|
||||
isFetching: PropTypes.bool.isRequired,
|
||||
publishMode: PropTypes.oneOf([SIMPLE, EDITORIAL_WORKFLOW]),
|
||||
siteId: PropTypes.string,
|
||||
};
|
||||
|
||||
static configError(config) {
|
||||
@ -87,6 +88,7 @@ class App extends React.Component {
|
||||
onLogin: this.handleLogin.bind(this),
|
||||
error: auth && auth.get('error'),
|
||||
isFetching: auth && auth.get('isFetching'),
|
||||
siteId: this.props.config.getIn(["backend", "site_domain"]),
|
||||
})
|
||||
}
|
||||
</div>
|
||||
|
Reference in New Issue
Block a user