Redirect users when logged in

Hello. I am attempting to send the user to /home route when they have logged in successfully I cant find that in the dashboard I am using Node.JS for this.

Hi SavDevv,

Thanks for reaching out to Auth0 Community!

As per my understanding the above issue can be resolved using auth0 Actions. Redirect with Actions, you can write the actions that will redirect user when they successfully logged in.

Regards,
Pavan.

Hi Pavan!
I have attempted to do that in server.js with:

exports.onExecutePostLogin = async (event, api) => {
  api.redirect.sendUserTo("http://localhost:3000/dashboard");
};

however this still takes me back to the home page
config:

const config = {
  authRequired: false,
  auth0Logout: true,
 // others are hidden
};

Solved, I was missing out some vital things.

1 Like

Hi SavDevv

Happy to hear you resolved the issue.

Can you please reply in this thread what exactly you missed while configuring so that it can help others in future.

Regards,
Pavan.