mirror of
https://github.com/kingomarnajjar/gatsby-starter-netlify-cms.git
synced 2026-07-25 22:27:24 +10:00
logs
This commit is contained in:
parent
30191e4c2d
commit
cc8bc53b1d
1 changed files with 2 additions and 0 deletions
|
|
@ -5,9 +5,11 @@ import Helmet from 'react-helmet';
|
|||
export default class IndexPage extends React.Component {
|
||||
componentDidMount() {
|
||||
if (window.netlifyIdentity) {
|
||||
console.log('Listener added');
|
||||
window.netlifyIdentity.on('init', user => {
|
||||
if (!user) {
|
||||
window.netlifyIdentity.on('login', () => {
|
||||
console.log('Redirect to admin');
|
||||
document.location.href = '/admin/';
|
||||
});
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue