Implementing User Creation on First Login with Auth0 and Flask

I had created a project using auth0 that uses react for the frontend with vite and flask for the backend. Currently I am making a call to my api everytime a user logs in checking if a user model is created in my db. If the user id doesn’t exist, I create a user otherwise nothing. But I was wondering if there was a way to somehow create a user once on first login/registration ever. Thanks in advance.

Hi @rodyli123

Welcome to the Auth0 Community!

Thank you for posting your question. If I understand correctly, you have an external database that creates a user model after users register for your application. If you are relying only on email+password connection type, you can use Post User Registration Flow to pass user data to your external database → Post User Registration Flow.

If, in your flow, you utilize the social connection, you can distinguish the first login with post login action → How to distinguish first login after sign up - #3 by supergrounded

I hope this will help you!
Dawid

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