In my app there is two type of user first is regular user
second is: admin which is only available for me
to enter admin panel, I need admin role in database. I have to set admin role in supabse. Now I am an admin role in supabse. but When I enter my credential to login in the app it is still recognize me as regular user
Did you know about these other v0 resources? A human should be here soon to help, but the answer may already be available even faster in one of these other posts.
This guide is a great place to start.
And these recordings can give you a look at v0 features and strategies in action: Topics tagged v0
Hi @adhamnor771-gmailcom, I’m not sure what you mean by that. It’d be great if you can add more information about what you are trying to achieve here using v0 and Supabase.
I recommend you to read through our How to Get Good Answers guide and add more details to your post.
In my app there is two type of user first is regular user
second is: admin which is only available for me
to enter admin panel. I need admin role in database. I have to set admin role in supabse. Now I am an admin role in supabse. but When I enter my credential to login in the app it is still recognize me as regular user
You role in the Supabase account is different than the role you get when you authenticate in your application using Supabase. They are two different things.
Now coming to what you want to achieve: there is no one correct answer to this.
If you only have two levels: you and everyone else. Then you can instruct v0 to create a function to check user email and if the email is yours, you see different UI than other users. This is the simplest way but the most naive.
You can ask v0 to create a roles table in Supabase to store the role information for all users including you. But this will be redundant at this stage as you only have two options.
You can also update the user metadata to add an additional field called “role” for each user.
Please note that these are very open ended situations for v0 or any AI to make. Hence, you need to be extremely careful to review the generated code and test thoroughly.