Closed infomiho closed 1 week ago
Good point! The tricky part with the UserEntityWithAuth
name is that it is correct in a sense that it represents a tree of full Prisma entities. The second type is derived from it by making it as minimal as possible to make the function as flexible as possible.
The problem is that the user will see this wacky (albeit correct) name, and we want to do better.
Some alternatives:
CompleteUserEntityWithAuth
, public: UserEnittyWithAuth
AuthEntityTree
, public: UserEnittyWithAuth
UserEntityWithAuthFields
, public: UserWithRequiredAuthFields
I maybe like the first option the best since it's just a Complete
vs nothing which gives us the relationship you suggested.
The auth helpers like
getEmail
andgetUsername
didn't work unless you provided the full user object with fullAuthIdentity
objects in theidentities
array.Given that we suggest to users to include only the
providerName
andproviderUserId
when manually fetching the user + auth + identities, we should make sure our auth helpers work in that scenario.This PR:
providerName
andproviderUserId
when using the helpers.