TTC
Theo's Typesafe Cultvibbin
Updating existing T3 with Supabase Auth from Next Auth
Background:
- Launched a T3 app with Next Auth.
- Currently got 3000 users.
- Launching an app version (expo), so migrating T3 app to T3-turbo.
- Upgrading Next-Auth to Supabase Auth to work with React Native, want to keep existing users and ease migration.
- Supabase generates an auth.users table.
I'm looking to guidance that I'm on the right track with my implementation.
1. I've added a new field to my existing Users table called SupabaseId. This will be the reference for Supabase Auth and my Users table. (Usually both id's would be the same.).
2. Created a webhook from Supabase when a new user is created in Supabase Auth (Signs up,in). The webhook hits an API to create a new user in the Users table of my DB and added the Supabase ID.
3. The new TRPC context. This bit feels abit hairy. I'm having to extend the supabase user and lookup the user from my DB on each request to add in the users ID and role.
Overall wondering if this approach is the correct one? My db id's are all cuid's and kind of wish I just started the uuid's and they seem much more used in industry.
Thanks
D
DavidNaak•367d ago
Hi,
I'm also building a web app and will need to build a react-native app later on. Would you recommend starting out with supabase auth straight away as it integrates into both?
Also, have you looked at solito.dev?
C
Complexlity•367d ago
Hello! Seeing the current context, he’s looking for answers himself. It feels burdensome to ask a question to him while he’s looking for help himself . I suggest you create a new post. This way you can get answers from anyone who’s looking
21KMembers
View on DiscordWant results from more Discord servers?
More PoststRPC + AppRouter without reactQueryhi everyone how can i host trpc on next.js and use trpc on server components without using react queMutate instantly returning success instead of isLoadingI have been working on this endpoint that uploads files do Google Drive. It can upload one or multipNext 13.4 problem with loading state after content is visible & hydration problemHey, I have a small app with Next 13.4 with Shadcn Ui 😍 it's really really good.
But I'm also usingis there a way to change/refresh token when data in db changes such as role?Hi, I had a project using NextAuth as my provider and the JWT strategy. When I use the database straRefresh a single React Server ComponetnsI have a dashboard where I want a certain piece of data to update every 10 seconds, what's the best Axios Singleton good or bad idea and how to implement?Hey ppl, I'm asking myself a question.
Is it a good idea to have a single instance of axios for an aNext-Auth in server rendered components aka appDir pageshow do we deal with next-auth in appDir? I am genuinely curious, as I am trying to migrate from pageAny Clerk gurus in here? Following the Next.js 13 getting started guide renders blank screenFollowing the getting started with nextjs guide for clerk renders a completely blank screen. I've fo