I’m new to Auth0 and I really appreciate the friendliness of this community. I have a conceptual question. I have a React App which uses Node.js and Express on the backend. I am doing my Authentication on the front end using the SPA set up (I hope this is the right thing to do with a front and back end). I want to link my project with a SQL DB but I am not sure what the normal set up is.
My first idea is to have the user login with Auth0 and then use either the token that comes back or the “sub” value on the returned user object as the unique identifier for my DB (not sure if one is better than the other or if a third option would be best). So when ever the
user object changes I would have a useEffect hook which would search the DB for either the token or sub and if it finds something in the DB it will return the user data. If it finds nothing it will create an entry.
Is this a typical way to link users with a DB and Auth0? I don’t want to run more queries than neccessary.