auth without netlify oauth provider
This commit is contained in:
parent
8735f68d31
commit
26d402149a
@ -13,12 +13,11 @@ export default class AuthenticationPage extends React.Component {
|
|||||||
|
|
||||||
handleLogin = (e) => {
|
handleLogin = (e) => {
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
let auth;
|
const cfg = {
|
||||||
if (document.location.host.split(':')[0] === 'localhost') {
|
base_url: this.props.base_url,
|
||||||
auth = new Authenticator({ site_id: 'cms.netlify.com' });
|
site_id: (document.location.host.split(':')[0] === 'localhost') ? 'cms.netlify.com' : this.props.siteId
|
||||||
} else {
|
|
||||||
auth = new Authenticator({ site_id: this.props.siteId });
|
|
||||||
}
|
}
|
||||||
|
const auth = new Authenticator(cfg);
|
||||||
|
|
||||||
auth.authenticate({ provider: 'github', scope: 'repo' }, (err, data) => {
|
auth.authenticate({ provider: 'github', scope: 'repo' }, (err, data) => {
|
||||||
if (err) {
|
if (err) {
|
||||||
|
@ -89,6 +89,7 @@ class App extends React.Component {
|
|||||||
error: auth && auth.get('error'),
|
error: auth && auth.get('error'),
|
||||||
isFetching: auth && auth.get('isFetching'),
|
isFetching: auth && auth.get('isFetching'),
|
||||||
siteId: this.props.config.getIn(["backend", "site_domain"]),
|
siteId: this.props.config.getIn(["backend", "site_domain"]),
|
||||||
|
base_url: this.props.config.getIn(["backend", "base_url"], null)
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
</div>
|
</div>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user