# Redirect after login complete

**URL:** <https://community.auth0.com/t/redirect-after-login-complete/148456>\
**Category:** Get Help\
**Tags:** new-universal-login-experience, login-experience\
**Created:** [October 3, 2024, 7:06am UTC](https://community.auth0.com/t/redirect-after-login-complete/148456 "2024-10-03T07:06:17Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![gianpiero.puleo](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/gianpiero.puleo/32/61053_2.png) [@gianpiero.puleo](https://community.auth0.com/u/gianpiero.puleo)\
**Post date:** [October 3, 2024, 7:06am UTC](https://community.auth0.com/t/redirect-after-login-complete/148456/1 "2024-10-03T07:06:17Z")

</div>

Hello,

I’m trying to redirect users after the login is **complete** with universal login.

What I mean is that I found how to do that with actions (post login trigger), but at that point the user is not authenticated yet.  
I need access to the user\_id post login, so the redirect before /continue is not working for that.

Unless I’m misunderstanding how the flow works 😕

Any help would be appreciated.

---

<div class="post-metadata">

**Author:** ![Fario\_Consulting](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/fario_consulting/32/60590_2.png) [@Fario\_Consulting](https://community.auth0.com/u/Fario_Consulting)\
**Post date:** [October 3, 2024, 10:00am UTC](https://community.auth0.com/t/redirect-after-login-complete/148456/2 "2024-10-03T10:00:42Z")

</div>

Hi Gianpiero,  
You could use a [Post Login Action](https://auth0.com/docs/customize/actions/explore-triggers/signup-and-login-triggers/login-trigger/redirect-with-actions)

---

<div class="post-metadata">

**Author:** ![tudor.smeu](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/tudor.smeu/32/59767_2.png) [@tudor.smeu](https://community.auth0.com/u/tudor.smeu)\
**Post date:** [October 3, 2024, 12:55pm UTC](https://community.auth0.com/t/redirect-after-login-complete/148456/4 "2024-10-03T12:55:02Z")

</div>

Hello @gianpiero.puleo,

Welcome to the Auth0 community!

The **Login Trigger** executes when a user **successfully** authenticates against an application on an Auth0 tenant. This also includes post-signup authentication.

I understand that you need to access to the `user_id`. You can access it with `event.user.user_id`. Feel free to check out the docs on the **Event object**. It provides information about the user logging in. [Actions Triggers: post-login - Event Object](https://auth0.com/docs/customize/actions/flows-and-triggers/login-flow/event-object)

I am sharing this documentation that explains the **Login Trigger** in more detail: [Login Trigger](https://auth0.com/docs/customize/actions/explore-triggers/signup-and-login-triggers/login-trigger)

I hope this was helpful and if anything is unclear, don’t hesitate to come back with more questions.

Thanks,  
Tudor

---

<div class="post-metadata">

**Author:** ![gianpiero.puleo](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/gianpiero.puleo/32/61053_2.png) [@gianpiero.puleo](https://community.auth0.com/u/gianpiero.puleo)\
**Post date:** [October 3, 2024, 2:42pm UTC](https://community.auth0.com/t/redirect-after-login-complete/148456/5 "2024-10-03T14:42:07Z")

</div>

Thank you Tudor, if I understand your answer, that’s not what I’m asking for.

If I get your point, I’m aware I can access `event.user.user_id`, but at that point I’m still in the post-login script.

My need is, after the whole process is complete, to redirect the user to a different webpage on my website.  
The only way I found so far is with `api.redirect.sendUserTo("/my/web/page")` but when it does that, the authentication is not over yet.

---

<div class="post-metadata">

**Author:** ![gianpiero.puleo](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/gianpiero.puleo/32/61053_2.png) [@gianpiero.puleo](https://community.auth0.com/u/gianpiero.puleo)\
**Post date:** [October 3, 2024, 2:51pm UTC](https://community.auth0.com/t/redirect-after-login-complete/148456/6 "2024-10-03T14:51:07Z")

</div>

Ok, I found the answer. Sometimes you just need to sleep on it 🙂

```auto
export const GET = handleAuth({
  login: handleLogin({
    returnTo: "/api/callbacks/signin",
  }),
  signup: handleLogin({
    returnTo: "/api/callbacks/signup",
    authorizationParams: { screen_hint: "signup" },
  }),
});

```

---

<div class="post-metadata">

**Author:** ![tudor.smeu](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/tudor.smeu/32/59767_2.png) [@tudor.smeu](https://community.auth0.com/u/tudor.smeu)\
**Post date:** [October 3, 2024, 2:53pm UTC](https://community.auth0.com/t/redirect-after-login-complete/148456/7 "2024-10-03T14:53:30Z")

</div>

I’m glad you managed to find a solution for your problem.

Also, thank you for sharing it with the community.

In the case you have any additional question, please come back to the community.

Thanks,  
Tudor

---

<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:** [October 17, 2024, 2:53pm UTC](https://community.auth0.com/t/redirect-after-login-complete/148456/8 "2024-10-17T14:53:43Z")

</div>

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