#Why SSR should be turned off?

8 messages · Page 1 of 1 (latest)

pearl trail
smoky lily
pearl trail
#

Awesome, thanks for enlighten me

trim field
wooden swift
# pearl trail Hi, according to the docs here https://appwrite.io/docs/tutorials/sveltekit-auth...

Appwrite Auth uses secure HTTP cookies to authorize. That means either browser or SSR server will have the cookie. If you had both enabled, and you had some guard logic (like redirect if not logged in), it could cause unexpected behaviour during SSR. Also, from personal experience, there can occur edgecases that then you need to prevent in code (with code like {#if data.user}).

In general I would personally recommend doing either ssr = false or csr = false in Svelte files +page.js and +layout.js, unless you have very specific use-case when you need both.
EDIT: You can mark your whole app SSR or CSR by doing this just once in your main layout.js, as that the applies to everything below it.

Regarding SSR in general, we will be adding support in next release. While it's supported already, you need a lot of appwrite-specific knowledge to achieve it which is not the experiece we aim for. In next release it will be simple, well documented and with many example demo apps.

pearl trail
#

Can't wait and try the next release.