# Redirecting to another page other than "/" using nextjs-auth0

**URL:** <https://community.auth0.com/t/redirecting-to-another-page-other-than-using-nextjs-auth0/66920>\
**Category:** Get Help\
**Created:** [July 28, 2021, 7:44am UTC](https://community.auth0.com/t/redirecting-to-another-page-other-than-using-nextjs-auth0/66920 "2021-07-28T07:44:45Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![mak76](https://upload.wikimedia.org/wikipedia/commons/thumb/7/7c/User_font_awesome.svg/768px-User_font_awesome.svg.png) [@mak76](https://community.auth0.com/u/mak76)\
**Post date:** [July 28, 2021, 7:44am UTC](https://community.auth0.com/t/redirecting-to-another-page-other-than-using-nextjs-auth0/66920/1 "2021-07-28T07:44:45Z")

</div>

I would like to achieve the same as the answer using nextjs-auth0 SDK. After successfully completing the login process, I would like to redirect the user to another URL i.ie. “/dashboard” not to “/”.

> [@Redirect URI issue after successful login with @auth0/auth0-angular](https://community.auth0.com/t/redirect-uri-issue-after-successful-login-with-auth0-auth0-angular/58111/2):
>
> Hi. It looks like what is happening is expected. Our Angular SDK is configured to work as follows: User initiates login by calling loginWithRedirect User is redirected to Auth0, including a redirectUri (in this case /callback) User is, after succesful authentication, redirected back to the provided redirectUri (in this case /callback) The callback URL is used only to process code and state in order to retrieve an actual token The user is then redirected again to / However, if you want to …

Code in my api/auth/[…auth0].js page

```auto
import { handleAuth, handleCallback } from "@auth0/nextjs-auth0";

export default handleAuth();

```

Configuration:

```auto
#AUTH0 CONFIGURATION 

AUTH0_SECRET= *****************************************
AUTH0_BASE_URL=http://localhost:3000
AUTH0_ISSUER_BASE_URL=https:// ****.us.auth0.com
AUTH0_CLIENT_ID= *****************************************
AUTH0_CLIENT_SECRET= *****************************************
AUTH0_AUDIENCE= *****************************************

```

Other information:  
SDK: nextjs-auth0  
version: ^1.5.0  
next-js: 11.0.1

How can I achieve it? Please let me know if the question is not clear.

---

<div class="post-metadata">

**Author:** ![mak76](https://upload.wikimedia.org/wikipedia/commons/thumb/7/7c/User_font_awesome.svg/768px-User_font_awesome.svg.png) [@mak76](https://community.auth0.com/u/mak76)\
**Post date:** [August 2, 2021, 11:11am UTC](https://community.auth0.com/t/redirecting-to-another-page-other-than-using-nextjs-auth0/66920/2 "2021-08-02T11:11:54Z")

</div>

Bumping!!!

I will highly appreciate your help/hints.

---

<div class="post-metadata">

**Author:** ![CTFries](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/ctfries/32/30887_2.png) [@CTFries](https://community.auth0.com/u/CTFries)\
**Post date:** [August 2, 2021, 4:09pm UTC](https://community.auth0.com/t/redirecting-to-another-page-other-than-using-nextjs-auth0/66920/3 "2021-08-02T16:09:41Z")

</div>

If you’re looking to send all signed in users to the same path, here’s the code I am using

```auto
import { handleAuth, handleLogin } from "@auth0/nextjs-auth0";

export default handleAuth({
  async login(req, res) {
    await handleLogin(req, res, {
      returnTo: "/##DESIREDPATH##",
    });
  },
});

```

I do know you can use some neat stuff with the returnTo configurations, I’d check out the SDK directly for more specific exmaples  
[https://github.com/auth0/nextjs-auth0](https://github.com/auth0/nextjs-auth0)

---

<div class="post-metadata">

**Author:** ![konrad.sopala](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/konrad.sopala/32/13516_2.png) [@konrad.sopala](https://community.auth0.com/u/konrad.sopala)\
**Post date:** [August 3, 2021, 9:59am UTC](https://community.auth0.com/t/redirecting-to-another-page-other-than-using-nextjs-auth0/66920/4 "2021-08-03T09:59:24Z")

</div>

Thanks for sharing it with the rest of community!

---

<div class="post-metadata">

**Author:** ![mak76](https://upload.wikimedia.org/wikipedia/commons/thumb/7/7c/User_font_awesome.svg/768px-User_font_awesome.svg.png) [@mak76](https://community.auth0.com/u/mak76)\
**Post date:** [August 3, 2021, 10:46am UTC](https://community.auth0.com/t/redirecting-to-another-page-other-than-using-nextjs-auth0/66920/5 "2021-08-03T10:46:17Z")

</div>

Thank you so much. I will check the SDK return to configuration.

---

<div class="post-metadata">

**Author:** ![konrad.sopala](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/konrad.sopala/32/13516_2.png) [@konrad.sopala](https://community.auth0.com/u/konrad.sopala)\
**Post date:** [August 3, 2021, 11:12am UTC](https://community.auth0.com/t/redirecting-to-another-page-other-than-using-nextjs-auth0/66920/6 "2021-08-03T11:12:25Z")

</div>

No worries! Let us know if you have any other questions down the road!

---

<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:** [August 18, 2021, 11:12am UTC](https://community.auth0.com/t/redirecting-to-another-page-other-than-using-nextjs-auth0/66920/7 "2021-08-18T11:12:54Z")

</div>

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