Netlify CMS Admin - Redirecting to other link

Hi guys, can i ask what is the problem when logging in to the netlifty admin (sample.netlify.app/admin) and once you used your account it will redirect to other site?

Thanks!

Could you try to explain the issue a bit further please :blush:

Hi @AaronP, you can check this one Loom | Free Screen & Video Recording Software | Loom

Im not sure where the issue came from, based from my last commit in branch I just edited pages.

Btw, thanks! :slight_smile:

Hey, so in your screen cap I see that your going from your limeproxies.netlify.app domain to your app.limeproxies.com domain. Is this intentional? Does the redirect issue happen if you try to login to your primary domain app.limeproxies.com/admin ? where does the redirect take you then?

I checked out app.limeproxies.com and it seems to be using a hashrouter. When I check https://app.limeproxies.com/admin I get a 404. Im not too sure I can debug much further without being able to view the repo or more information :slight_smile:

Thank you!

EDIT:

Just wanted to add that you could also try adding a handler directly to the login widget:

 if (window.netlifyIdentity) {
    window.netlifyIdentity.on("init", user => {
      if (!user) {
        window.netlifyIdentity.on("login", () => {
          document.location.href = "/admin/";
        });
      }
    });
  }

if you add this in a script tag to your main index page.

Hi, no its not intentional. Thats the bug i get when i try to login in limeproxies.netlify.app/admin/#/

app.limeproxies.com is not part of limeproxies.netlify.app cms/admin, when im trying to access limeproxies.netlify.app/admin/#/ ( first it tell me to login with netlify identity, then login with continue with google accounts, and then it goes to this link (Lime Proxies) )

i dont know what is the problem/bug, basically its redirecting to app.limeproxies.com after i login with netlify identity, thats the problem.

Btw, this happen last 2 days. Before its working, i can access the admin page and add data in cms collections.

Also, i already have the code you added.

Thank you!! :slight_smile:

Hi @AaronP, it’s fixed now. It’s in domain management which the link of default subdomain is redirecting.

Btw, thanks for your time and effort. :+1:

ohh interesting. Thanks for coming back to help others!