404 Implicit Callback GET on login - React SPA

Hi, we’re getting a console GET Error on the implicit callback virtual route. This is happening only on login in a staged environment, not locally. While not a breaking change, the error isn’t ideal.


We’re using an Azure environment hosted as a static website via a storage account.
I’ve set a base href on the document to “/” and also set any errors to go to index.html, as well as the default path is index.html.

If you’re getting a 404, it means your SPA configuration is not complete on your web server. You should never get a 404 from this route if you have it setup correctly. Rather, it should route the request to your index.html so React can handle it.

1 Like

Good to know. I’ll look further into our web server setup. Thank you for the quick response.

I was also running into this issue with a Vue SPA when running in a docker container. For me, here is what worked.

  1. Make sure router is using history mode.
  2. Add a nginx config file and at the very least, add the following to allow the redirect to the callback url. In my case 'login/callback.
http {
    server {
        listen 80;
        root  /usr/share/nginx/html;
        include /etc/nginx/mime.types;

        location / {
            try_files $uri /index.html;
        }
        location /login/callback/* {
            try_files $uri /index.html;
        }
    }
}

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.