Home
Support Forums

Change Netlify Identity redirect for CMS

Hi,

is it possible to adjust the redirect url for the Netlify Identity authentication?
Because I would like to put this script on a dedicated page:

{# Needed for oauth authentication for CMS admin #}
<script>
  if (window.netlifyIdentity) {
    window.netlifyIdentity.on("init", user => {
      if (!user) {
        window.netlifyIdentity.on("login", () => {
          document.location.href = "/admin/";
        });
      }
    });
  }
</script>

And PS: Can someone tell me why, when inviting a user to the CMS the invitation link in the email points to the homepage and not the /admin ?
The link in invitation email, goes to https://mydomain.com/#invite_token=Shdkgkfhfkgjidfjkf

I believe that’s what role based redirects are for:

And PS: Can someone tell me why, when inviting a user to the CMS the invitation link in the email points to the homepage and not the /admin ?
The link in invitation email, goes to https://mydomain.com/#invite_token=Shdkgkfhfkgjidfjkf

Checkout this topic:

The invitation link doesn’t point to the admin page because Identity isn’t exclusively made for Netlify CMS.

1 Like

Noice! Thanks @tomrutgers I will check all this out now :slight_smile:

Good stuff, thanks for making it ready to be copied & pasted

2 Likes