# Redirection to login site not working

**URL:** <https://community.auth0.com/t/redirection-to-login-site-not-working/104456>\
**Category:** Get Help\
**Tags:** classic-universal-login-experience, login-experience\
**Created:** [April 11, 2023, 1:13pm UTC](https://community.auth0.com/t/redirection-to-login-site-not-working/104456 "2023-04-11T13:13:58Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![emy](https://upload.wikimedia.org/wikipedia/commons/thumb/7/7c/User_font_awesome.svg/768px-User_font_awesome.svg.png) [@emy](https://community.auth0.com/u/emy)\
**Post date:** [April 11, 2023, 1:13pm UTC](https://community.auth0.com/t/redirection-to-login-site-not-working/104456/1 "2023-04-11T13:13:58Z")

</div>

Hello,  
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:  
\<Auth0Provider  
domain={domain}  
clientId={clientId}  
**redirectUri={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

---

<div class="post-metadata">

**Author:** ![rueben.tiow](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/rueben.tiow/32/11646_2.png) [@rueben.tiow](https://community.auth0.com/u/rueben.tiow)\
**Post date:** [April 11, 2023, 3:46pm UTC](https://community.auth0.com/t/redirection-to-login-site-not-working/104456/2 "2023-04-11T15:46:34Z")

</div>

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:

```auto
<Auth0Provider
  domain={domain}
  clientId={clientId}
  authorizationParams={{ redirect_uri: window.location.origin }}}>
  <MyApp />
</Auth0Provider>

```

(Reference: [Auth0Provider | @auth0/auth0-react](https://auth0.github.io/auth0-react/functions/Auth0Provider.html))

Please let me know how this goes for you.

Thanks,  
Rueben

---

<div class="post-metadata">

**Author:** ![emy](https://upload.wikimedia.org/wikipedia/commons/thumb/7/7c/User_font_awesome.svg/768px-User_font_awesome.svg.png) [@emy](https://community.auth0.com/u/emy)\
**Post date:** [April 12, 2023, 2:04pm UTC](https://community.auth0.com/t/redirection-to-login-site-not-working/104456/3 "2023-04-12T14:04:09Z")

</div>

Hi,

Thank you for your help, this solved my problem! 🙂

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/auth0/original/3X/b/5/b560f266932fcce5d57f09a6595bd50518cae3f3.jpeg) [@system](https://community.auth0.com/u/system)\
**Post date:** [April 26, 2023, 2:04pm UTC](https://community.auth0.com/t/redirection-to-login-site-not-working/104456/4 "2023-04-26T14:04:14Z")

</div>

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