This commit is contained in:
Austin Green 2017-10-27 21:31:00 -04:00
parent 30191e4c2d
commit cc8bc53b1d

View file

@ -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/';
});
}