As a recent graduate of a Full Stack Bootcamp, I am diving into NextJS and exploring Supabase for authentication. I may have some beginner questions, so bear with me.
Currently, I am utilizing a NextJS TypeScript template and incorporating Supabase for authentication:
- I'm interested in storing signup form data (specifically user role, callsign, firstname, and lastname) directly in the database's users table using Supabase, rather than in the session or raw_user_meta_data. Is it feasible to achieve this through Supabase? I've already added two new columns to the auth.users table via the SQL editor in my Supabase account. The goal is for the user's information to be saved in the auth.user table upon initial signup.
Here's a snippet of code for reference:
sign-up-form.tsx
import ....
const schema = zod.object({
// Code omitted for brevity
});
// More code not included here
return(
Form....
......
signUp function (GoTrueClients.ts)
// Code snippet not shown here
middleware.tsx:
// Code excerpt excluded
2. Post login, I aim to retrieve the user's role from the auth.users table in the database to dynamically render different dashboards based on the fetched user role.
Per the Supabase documentation (), one can fetch data like so:
// Code example provided but certain modules and functions seem to be missing
Apologies for the novice inquiries. Any pointers or recommendations for additional resources or GitHub repositories would be greatly appreciated!
What am I overlooking?