seting site_id automatically only for localhost
This commit is contained in:
parent
7345c7bd32
commit
d7324bd743
@ -14,8 +14,13 @@ 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();
|
||||
}
|
||||
|
||||
const auth = new Authenticator({site_id: 'cms.netlify.com'});
|
||||
auth.authenticate({provider: 'github', scope: 'repo'}, (err, data) => {
|
||||
if (err) {
|
||||
this.setState({loginError: err.toString()});
|
||||
|
@ -29,8 +29,8 @@ const PROVIDERS = {
|
||||
};
|
||||
|
||||
class Authenticator {
|
||||
constructor(config) {
|
||||
this.site_id = config.site_id;
|
||||
constructor(config = {}) {
|
||||
this.site_id = config.site_id || null;
|
||||
this.base_url = config.base_url || NETLIFY_API;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user