# Auth0-react "loginWithRedirect" redirects user to 404

**URL:** <https://community.auth0.com/t/auth0-react-loginwithredirect-redirects-user-to-404/64927>\
**Category:** Get Help\
**Tags:** auth0-react, login\
**Created:** [June 23, 2021, 10:13am UTC](https://community.auth0.com/t/auth0-react-loginwithredirect-redirects-user-to-404/64927 "2021-06-23T10:13:54Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![ph11x](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/ph11x/32/30172_2.png) [@ph11x](https://community.auth0.com/u/ph11x)\
**Post date:** [June 23, 2021, 10:13am UTC](https://community.auth0.com/t/auth0-react-loginwithredirect-redirects-user-to-404/64927/1 "2021-06-23T10:13:54Z")

</div>

Hi,  
I followed the steps of this tutorial [Link](https://auth0.com/docs/quickstart/spa/react/01-login),  
because I wanted to make a login with the Auth0 React SDK using context hooks (loginWithRedirect).  
When I click the login button (onClick={ loginWithRedirect }) it redirects to  
**https//myDomain.eu.auth0.com/authorize?client\_id=loremIpsum…**  
myDomain being the correct auth0 domain… which shows a 404 page (“website is not availlable”)

Shouldn’t it be …/login? instead of /authorize? Am I missing any api endpoint I have to implement myself?Or is it an auth0 application setting I have to take care of?  
I have basically seen every next.js, auth0-react tutorial and nothing helps.

---

<div class="post-metadata">

**Author:** ![stephanie.chamblee](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/stephanie.chamblee/32/26087_2.png) [@stephanie.chamblee](https://community.auth0.com/u/stephanie.chamblee)\
**Post date:** [June 23, 2021, 1:45pm UTC](https://community.auth0.com/t/auth0-react-loginwithredirect-redirects-user-to-404/64927/3 "2021-06-23T13:45:22Z")

</div>

Hi @ph11x,

Welcome to the Community!

It is correct that the `loginWithRedirect` call redirects to the `/authorize` endpoint, however, if the request was successful, then you’d be redirected again to the `/login` URL. (Here are details on the complete flow: [Authorization Code Flow](https://auth0.com/docs/flows/authorization-code-flow))

Have you tried using the orange “LOG IN & DOWNLOAD SAMPLE” button on the quickstart guide you’ve linked? If you use that and select a single page app from your tenant, then the configs will be pre-populated.

If that does not work, could you please send me a private message with your tenant name so that I can take a look at the settings? Thanks!

---

<div class="post-metadata">

**Author:** ![ph11x](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/ph11x/32/30172_2.png) [@ph11x](https://community.auth0.com/u/ph11x)\
**Post date:** [June 24, 2021, 8:01am UTC](https://community.auth0.com/t/auth0-react-loginwithredirect-redirects-user-to-404/64927/4 "2021-06-24T08:01:12Z")

</div>

Thank’s a lot. I’ve checked the settings again and changed the token endpoint authentication method from post to none and application type from regular page application to single page app. Now it works

---

<div class="post-metadata">

**Author:** ![stephanie.chamblee](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/stephanie.chamblee/32/26087_2.png) [@stephanie.chamblee](https://community.auth0.com/u/stephanie.chamblee)\
**Post date:** [June 24, 2021, 11:22am UTC](https://community.auth0.com/t/auth0-react-loginwithredirect-redirects-user-to-404/64927/5 "2021-06-24T11:22:29Z")

</div>

Awesome! Glad to hear you got it working!

---

<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:** [July 9, 2021, 11:23am UTC](https://community.auth0.com/t/auth0-react-loginwithredirect-redirects-user-to-404/64927/6 "2021-07-09T11:23:00Z")

</div>

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