chen-rn / CUA

(deprecateed) create-universal-app(CUA) is an opinionated template for creating fullstack universal apps (Expo, Next, tRPC, Prisma, Clerk, Solito, Tamagui)

Home Page:https://cua-demo.vercel.app

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Store user profile on the database at sign up time

RicardoPBarbosa opened this issue · comments

Is it possible to call trpc on app/utils folder to create a db entry for a user signing up?
If not, how should I approach that?

P.S:
@chen-rn Thank you for your work on this. It's really awesome!

commented

For sure!
I'll try to add this in soon! It is a missing piece for sure
For now, if you'd like, you can call the create mutation in the user router with the email/name and whatever other information you want to store!

commented

I've added this in the newest commit! Should work now :)

Great stuff, the only thing that doesn't work is the user creation on social auth on web.
It's like it doesn't communicate well here: handleOAuthSignUpWithPress(app/features/signup/screen.tsx:18)

commented

Ahh good catch, yea it seems my approach is a little off since the user will be redirected to the OAuth site.

Seems like a better way to do oauth is something like this. Lemme fix that.

commented

Apologies for the delay, I made an update and tested on both expo and web so it should be working now!
The code might seem a little chunky but sharing auth/navigation code across mobile/web made this a little bit more complex.

I'll close this for now, if something else pops up I'll reopen it!

Thank you Chen, really appreciate it 🙏