How to add query param to redirect_uri in a post-login action

Hi,
We’re trying to add some data to the redirect url where the user gets sent after successful authentication using auth0 “post login” actions.

example:
in our spa app, we call:

loginWithRedirect({
            screen_hint: "signUp",
            redirectUri: `https://myapp.domain.com/#/signup-completed`,
        });

in the auth0 action, I’d like to add a query param so that the user gets redirected to https://myapp.domain.com#/signup-completed?what=true after successful login.

The only thing I’ve found in actions is api.redirect.sendUserTo. However, this seems to be for use-cases where the action performs a temporary redirect that is expected to send the user back to auth0 to continue the workflow via onContinuePostLogin. My use case is to manipulate the final redirect where the user gets sent after the entire actions workflow chain completes. Is this possible?

Hi @trondhindenes,

You won’t be able to add a param to the redirect URI in an Action. You can find strategies for redirecting users after login here:

Hi @trondhindenes

This question might help you Passing data from Action to the consuming client app

Thanks
Jeff

2 Likes

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