Open onimitch opened 1 month ago
I've also just noticed that with this set up:
model User {
@@ignore
id String @id
}
model RealUser {
id String @id @default(cuid())
}
The type of user
in enhance
call is simply Record<string, unknown>
. It would be nice if Zenstack could still generate the correct type based on the Model fields.
OK going to edit the bug. It looks like @@ignore
is a red herring. @@auth
simply doesn't work if you have a model called User.
Description and expected behavior If you specify
@@auth
on a model but also have aUser
model defined, Zenstack uses theUser
model for theAuthUser
type.With the models above, enhance expects a type matching
User
despite me markingAuthUser
as@@auth
.Currently my workaround is to not use
@@auth
, and name my AuthUser modelUser
, but that's forced me to name my "real" User model to something else, which I don't want to do.Expected behaviour
I can use
@@auth
on a Model and still define a User model myself.Environment (please complete the following information)