Redirection to login site not working

I am have trouble with the redirecting to the auth0 login page.
When my button is clicked, it calls the loginWithRedirect() function, the page starts loading but then shows a standard error “Hmm. We’re having trouble finding that site.”.
I have built made my button catch errors and print in the console, but it does not find any error happening. So im not sure what the problem is.

My project is in ts and I use react framework.
I try to run it locally and have all 3 fields Allowed Callback URLs, Allowed Logout URLs and Allowed Web Origins being my localhost adress.
Ive tripple checked that the client id and domain variables is right.
I am also using the latest version of auth0 on my project.
My project does have a backend in Express but I have not done any connecting between the backend and the auth0 since I understood it as auth0 only requiring the frontend part.

Ive also seen tutorials where people use the redirectUri:
But in my project it complains that it does not exist on the type Auth0Provider. So I do not have that property. Maybe the redirectUri could be the problem?

I understand that it might be hard to know what the problem is since I can not post the whole code, but maybe someone have had a similar problem and know what i can try?

Thank you

Hi @emy,

Welcome to the Auth0 Community!

I understand that you’ve experienced issues with trying to get to the login page.

It looks like the redirect_uri is part of the authorizationParams. With that said, I recommend specifying your Auth0Provider, something like the following:

  authorizationParams={{ redirect_uri: window.location.origin }}}>
  <MyApp />

(Reference: Auth0Provider | @auth0/auth0-react)

Please let me know how this goes for you.



Thank you for your help, this solved my problem! :slight_smile:

1 Like

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