#How to setup the preview mode with a multi-sites Payload

1 messages · Page 1 of 1 (latest)

rustic stream
#

Similar to the multi-tenant example, my Payload API is used by multiple websites. To achieve that, I have a website collection with a URL and slug fields that needs to be referenced when creating a page. All of the above, as well as the front-end build and the revalidation, works as expected.

For the preview mode, I tried to follow the draft-preview example:
https://github.com/payloadcms/payload/tree/master/examples/draft-preview

Even though I can add multiple values to the cors and crsf configuration, I'm unable to add multiple domains to the auth.cookies configuration. Because of that, my authentication cookie isn't set on my websites and I'm unable to use the payload token.

Looking at the multi-tenant example doesn't help because there's no front-end, preview logic or authentication configuration:
https://github.com/payloadcms/payload/tree/master/examples/multi-tenant

Is there another way of handling previews for multi-sites and multi-tenants setup?
Thank you very much!

patent swiftBOT