old_contents: // JS Goes here - ES6 supported
  if (window.netlifyIdentity) {
    window.netlifyIdentity.on('login', () => {
      document.location.href = '/admin/';
    });
  }
  
new_contents: // JS Goes here - ES6 supported
  if (window.netlifyIdentity && !window.netlifyIdentity.currentUser()) {
    window.netlifyIdentity.on('login', () => {
      document.location.href = '/admin/';
    });
  }
  
subject: Fix issue with always redirecting to /admin when logged in