Passing Custom Data from loginWithRedirect to PostLogin Action

Hello, Auth0 Community!

I’m currently implementing Auth0 for user authentication in my application, using the loginWithRedirect method on the frontend. I’m trying to find a way to pass custom data from this frontend method to a PostLogin Action.

Here’s a high-level overview of what I’m attempting to do:

  1. User initiates an authentication transaction on the frontend.
  2. As part of this transaction, I want to capture and send some additional custom data (not just the standard authentication data).
  3. After the user successfully authenticates, a PostLogin Action is triggered.
  4. In this PostLogin Action, I want to access and utilize the custom data I captured on the frontend during step 2.

The PostLogin Action event object provides a wide range of information about the authentication transaction, but none of these properties seem intended for passing custom data directly from the client to the backend.

My question is: How can I pass this custom data from the frontend loginWithRedirect method to the PostLogin Action? Are there any recommended best practices or workarounds for this type of data passing in Auth0?

Thank you for any help or guidance you can provide!

1 Like

Hi @davidstellini,

Welcome to the Auth0 Community!

You can pass data to an Action by including it in the the request’s query params. You can then use the event.request.query property to access those params in your Action.

Please let me know if you have any questions!

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