Hi I am creating a web application with next.js (node framework) and using Auth0 to setup authentication, following this tutorial: “https://auth0.com/blog/next-js-authentication-tutorial/”
I have reached the end of the tutorial and it works fine, I’m happy with the implementation. Next I am trying to associate users created on Auth0 with a local MySQL database for app specific data. I intend use a unique identifier ID to associate users with their respective data. I was originally also going to copy over the username/nickname, real name and email but I likely do not need to do that.
I did some googling and saw the use of post-user-registration-hook, and I thought about using that to call an API, but I would need to set the API on a internet facing server with a database, I can do that but I’m thinking about local for development.
I have a local MySQL instance and am planning to create an API endpoint to create a user in the database with info from Auth0. I have tried adding some test code to the /callback endpoint inside auth-routes.js (from the tutorial) with an await to a simple endpoint which just returns a text response for now, using console.log to test. However after trying to log in or signup to see if my code is executed, it is not.
What’s the correct way to do this?