Used Auth0 to Seperate User Data from each others

Can anyone give me an idea on how could I separated my user data from each other by Auth0. I am currently working on a todoapp project and I don’t have any idea on how to create a separate database(or table?) each time a new user create their account through Auth0.
I greatly appreciate help

Hey there @longta3110 welcome to the community!

If I’m understanding your question correctly, I think your best bet is to use a Post User Registration Action to make a call to your own API/Database in order to create the newly registered user - It might look something like this for example:

exports.onExecutePostUserRegistration = async (event, api) => {
  const axios = require('axios');

  try {
    const response = await axios.post('https://my-api.com/users', {
      auth0_id: event.user.user_id,
      email: event.user.email
    });

    console.log(response);
  } catch (error) {
    console.log(error);
    // handle your error as needed
  }
};

Hope this helps!

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