// JS Goes here - ES6 supported
if (window.netlifyIdentity) {
  window.netlifyIdentity.on('login', () => {
    document.location.href = '/admin/';
  });
}

// JS Goes here - ES6 supported
if (window.netlifyIdentity && !window.netlifyIdentity.currentUser()) {
  window.netlifyIdentity.on('login', () => {
    document.location.href = '/admin/';
  });
}

Fix issue with always redirecting to /admin when logged in
Fix issue with always redirecting to /admin when logged in
