wasp-lang / wasp

The fastest way to develop full-stack web apps with React & Node.js.
https://wasp-lang.dev
MIT License
13.49k stars 1.18k forks source link

In Auth docs, advise how to deal with User data (storing it in User object vs fetching from Auth -> Identities) #2034

Open Martinsos opened 4 months ago

Martinsos commented 4 months ago

While we do somewhat mention this stuff, and we do have part in docs that tells how to populate a user in Prisma query, the fact is that this is just quite complex, and it is not easy for a user to figure out how to best go around this.

In this piece of docs, we should give them guidance on how to deal with User data. We should point to them that they can, during signup, by using userSignupFields, store fields directly on the User. We should give some examples, explain when it should be done, when not. We should demonstrate how to fetch the data about user in different situations -> how to do it when they have AuthUser available, vs how to do it when they want to populate user in Prisma query (related: https://github.com/wasp-lang/wasp/issues/2033).