Closed sidharthv96 closed 1 year ago
Thanks for reporting this @sidharthv96 ! I'm looking into it and will update back soon.
Hi, I tried with a Postgres setup but couldn't reproduce the issue. Could you check if all your zenstack dependencies are of the same version? You can run npx zenstack info
to get it.
My setup is shared here if it helps: https://github.com/ymc9/zenstack-380
Thank you for the repro. It runs fine in the repro.
I did a workaround to use the old prisma if user isn't available. But now it works even after removing that. Didn't do any changes to zenstack or prisma versions.
It's really weird.
--
I noticed you had used withPresets in the repro, but the docs mention withPolicy https://zenstack.dev/docs/get-started/backend. Is there any difference between the two?
--
Also, prisma is throwing this warning
imports from "@prisma/client/runtime" are deprecated.
Use "@prisma/client/runtime/library", "@prisma/client/runtime/data-proxy" or "@prisma/client/runtime/binary"
Thanks for trying it out. It is weird. Do you recall installing an older version of ZenStack before? Anonymous user wasn't handled cleanly in previous versions but it has been fixed within the past two weeks or so.
withPresets
is simply a shortcut for combining withPolicy
, withPassword
and withOmit
. It's equivalent to withPolicy
in terms of validating access policies.
The deprecated Prisma dependencies is tracked by an issue here and I think it can be resolved soon.
I haven't installed an older version before. First time installing in the repo yesterday. Thanks for the prompt response. I'll use the repro to report any new errors I see.
Description and expected behavior
The idea is for public Documents to be accessible for everyone.
But the query fails with this error when no user is passed.
Screenshots If applicable, add screenshots to help explain your problem.
Environment (please complete the following information):
Additional context Add any other context about the problem here.