Recieve additional data from auth0 webhook

Ok so this is the login flow of the user:

  1. User visits /login
const config = {
    authRequired: false,
    auth0Logout: true,
    secret: env.auth_secret,
    baseURL: env.auth_base_url,
    clientID: env.auth_client_id,
    issuerBaseURL: 'url',

};

app.use(auth(config));
  1. User logs in or signs up through the login prompt created by auth0
  2. When login is successfull webhook from auth0 sends data to /user/verified
const axios = require("axios");
const URL = 'https://0bg7-34-200-103-108.ngrok-free.app/user/verified';
exports.onExecutePostLogin = async (event, api) => {
  
  try {
    await axios.post(URL, {data: event, secret: event.secrets.webhook_secret});
    
   
  } catch (error) {
    console.error(error)
  }
};
  1. In my backend i check if the user is verified or not

Question:

Lets say the user enters /login/someData/

How could i recieve someData in my /user/verfied endpoint?

I am using nodejs as my backend.

Hi @elias.knudsen,

To understand your question better, could you please clarify how the user enters “/login/someData/” during the login process? Or what you mean by “/login/someData/”?

Thanks,
Rueben

/login/someData

would be like this:

app.get('/login/:referral_code', (req, res) => {
    const referral_code = req.params.referral_code
    //Route user to universal login page from auth0

});

My main goal is that the webhook from the postlogin flow should contain this referral_code, so i can access it at /user/verified

Here is an illustration:)

Hello Elias,

We did something similar, we use the Auth0 Actions to save the data in your case referral_code the users meta data and then attached referral_code to the token.