Not authenticating - stuck on loading (React + TS + Vite)

This is my first time working with react/Auth0 and I cannot find the reason for this issue. Maybe someone can help.

Auth0 is imported, domain and ID defined, properties (isauthenticated, isLoading and LoginWithDirect) imported as well.

For testing I also have a login and a logout button.

Content is wrapped in:

<Auth0Provider
domain={domain}
clientId={clientId}
authorizationParams={{
redirect_uri: “/callback”,
}}
>

with:

<Route path=“/callback” element={} />

When I click the login button, it redirects to the Auth0 interface and after successful login back to /callback.

Printing isLoading and isAuthenticated to the console, isLoading = true; isAuthenticated = false

When I integrate an automatic redirect: In App.tsx I use:

if (!isAuthenticated && !isLoading) {

loginWithRedirect();
    return null;
  }

if (isLoading) {
    return <p>Loading...</p>;
  }

the page only shows “Loading…”

Where could I look for troubleshooting? Link settings all seem to be correct. I followed the instructions, do I need to do something else in my app? When being redirected to my app, it shows a key in the URL that disappears after 2-3 seconds, is my App meant to somehow grab that information? Do I have to resolve it with Routing?

Thanks a lot for your help :slight_smile:

Crosspost with StackO