I have a Django Backend with a Next.JS frontend.
I have been trying for two days to add a simple variable to determine a user’s type/role when they sign up.
The way I have it set up right now, is that the user signs up on the frontend, the backend receives a user.created Clerk webhook with the user data, and adds a row in my database.
I have two different sign-up pages, (similar to how Uber has a driver and signup pages separated, or other apps of the sort). When the user signs up, I want that specific role (based on which page they’re signing up from) to be either saved in the Clerk User’s metadata, which my backend can access in the Clerk Webhook or by manually pulling it, OR for the Clerk sign up flow to be fully customized, and a call to my backend to be made to add the proper user role, upon sign up complete on my frontend.
Does anyone have a working concept to get this done? It’s so basic and simple, I can’t believe that I am not able to figure it out. My brain must be fried.
Thank you!
I have tried everything I could. That includes:
- Using the built-in SignUp component and passing it props.
- using Clerk Elements to build a custom Sign Up flow with a custom form field like this doc describes: https://clerk.com/docs/customization/elements/guides/sign-up
- Creating a fully custom NextJS sign up form with my own components, and using useClerk() as client with client.SignUp.create().
Point is, everything works, I am always successful in creating the user, verifying the email and phone number with codes, but I am never able to make my role carry through to my backend to be able to add it to my db.
Valentin Bonetbelche is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.