Can you set a value to event.transaction.redirect_uri in a post-login action?

I’ve written a post-login action and have implemented the onExecutePostLogin and onContinuePostLogin functions. In those functions, depending on who the user logging in is (which of two apps he’s allowed to access, or both apps) I want to send him to a particular URL.

In other words, I want to change the redirect_uri that the login was initiated with, based on who the user is.

I’m operating under the following assumption. In either of the two functions, I should be able to do something like this:

event.transaction.redirect_uri = 'https://theSelectedUri';

Does that actually do anything? My assumption is that when login completes and the user has been authenticated, that’s where he will end up, regardless of the original URI configured for the login.

Please note, I am not talking about performing a api.redirect.sendUserTo. My understanding of that is that the user is redirected with that before authentication is completed, so that custom things can be done in an external page. That’s not what I want to do.

I want to figure out who the user is, where he should go, and then send him there.

In short, is event.transaction.redirect_uri only readable, or is it writable as well?

Hoping to re-open this thread since this question was not raised in the AMA session. Is it possible to re-assign the event.transaction.redirect_uri within a post-login action?

2 Likes

Hey team! :waving_hand:

Since this topic touches Auth0 Actions, quick heads-up that we’re hosting an Ask Me Anything dedicated to Actions with Gaston Danilo Asis Sanchez, Senior Technical Product Manager. We’ll cover practical usage, new capabilities like Transaction Metadata and Actions Types, plus a peek at what’s next. :sparkles:

  • Submit questions now through Aug 26 :writing_hand:
  • Get detailed written answers live on Aug 27, 9–11 AM PT :speech_balloon:

Earn community points + a badge :trophy:. If you’re exploring how Actions can streamline your auth flows, this is a great time to get direct guidance from the team.
Join the AMA & drop your questions here: August 27 Auth0 Community Ask Me Anything: Actions

Dawid