johannschopplich / kirby-vue3-starterkit

✨ Kirby + Vue SPA starter: automatic routing, i18n, SEO and more!
MIT License
206 stars 19 forks source link

Fix: broken routing when logged out #40

Closed ghost closed 2 years ago

ghost commented 2 years ago

@johannschopplich

I’ve just realised that the proposed draft preview fix earlier introduced a bug for logged out users, where all pages redirected to the error page.

Here isReadable() is replaced by isVerified(). In order to make this work, the query token needs to be attached to all .json requests as well. Otherwise the data could either not be fetched or would be publicly exposed.

https://getkirby.com/docs/reference/objects/cms/page/is-verified

Sorry for introducing the bug prior. This should fix it.

ghost commented 2 years ago

@johannschopplich done, sorry again for the broken pull request prior!

johannschopplich commented 2 years ago

It's fine — should've checked myself. So it's on us both. 😉 Thanks for the overhaul!