© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
SupabaseS
Supabase•3y ago•
6 replies
erinho255

User role stored in public.users or raw_user_meta_data?

Hello,

Is it a good practice to add the user's role in raw_user_meta_data of auth.users? Knowing that the role will be used in the JWT to check the "student", "admin", "teacher" role before granting access. Given that a malicious user uses Postman to register and pass the "admin" role in raw_user_meta_data or to call updateUser() and modify its role.
How can I proceed?

My public.users table has a userrole column of type enum of "student", "admin", "teacher", which is inserted automatically thanks to a trigger on auth.users

Can someone help me please on that?
Thanks!
Supabase banner
SupabaseJoin
Supabase gives you the tools, documentation, and community that makes managing databases, authentication, and backend infrastructure a lot less overwhelming.
45,816Members
Resources

Similar Threads

Was this page helpful?
Recent Announcements

Similar Threads

RAW_USER_META_DATA
SupabaseSSupabase / help-and-questions
4y ago
new.raw_user_meta_data
SupabaseSSupabase / help-and-questions
4y ago
declare unique property in `raw_user_meta_data`
SupabaseSSupabase / help-and-questions
3y ago
Modifying raw_user_meta_data at registration
SupabaseSSupabase / help-and-questions
8mo ago