marmelab/ra-auth-auth0

Invalid State

Nulithic opened this issue · 3 comments

I am getting an Invalid state when following the documentation. Here is what I have for my code:

image

App.tsx

const auth0 = new Auth0Client({
  domain: import.meta.env.VITE_AUTH0_DOMAIN,
  clientId: import.meta.env.VITE_AUTH0_CLIENT_ID,
  cacheLocation: "localstorage",
  authorizationParams: {
    audience: import.meta.env.VITE_AUTH0_AUDIENCE,
  },
});

const authProvider = Auth0AuthProvider(auth0, {
  loginRedirectUri: import.meta.env.VITE_LOGIN_REDIRECT_URL,
  logoutRedirectUri: import.meta.env.VITE_LOGOUT_REDIRECT_URL,
});

export const App = () => (
  <BrowserRouter>
    <Admin authProvider={authProvider} dashboard={Dashboard}>
      <Resource name="Billing Transactions"></Resource>
    </Admin>
  </BrowserRouter>
);

.env

VITE_AUTH0_DOMAIN="asdfasdf.us.auth0.com"
VITE_AUTH0_CLIENT_ID="asdfasdf"
VITE_AUTH0_AUDIENCE="https://asdfasdf.us.auth0.com/api/v2/"
VITE_LOGIN_REDIRECT_URL="https://mywebsite.com/auth-callback"
VITE_LOGOUT_REDIRECT_URL="https://mywebsite.com"

Auth0 Application URIs

Application Login URI: Blank
Allowed Callback URLs: https://mywebsite.com/auth-callback
Allowed Logout URLs: https://mywebsite.com
Allowed Web Origins: https://mywebsite.com
Allow Cross-Origin Authentication: https://mywebsite.com
djhi commented

There's usually more informations in the response from auth0 in the network tab. Can you check and report here?

I am not sure what I should be looking for in the network tab. All the network requests are in the status of either 200, 302, or 304.

What is interesting is that when I try to log in from Firefox it works, but Chrome (Incognito as well) is giving me this invalid state.

(edit) After looking in the Auth0 Monitoring > Logs it is saying that it was a Sucessful login even though I got an Invalid State.