Back

[CLOSED] Access session on nuxt server side

  • 0
  • Self Hosted
  • Web
leonardorick
12 Oct, 2023, 14:55

Is there a way to run const session = await auth.getSession('current'); on nuxt.js plugin initializer and get the session object on nuxt server side?

I run it and on the browser it works but on the nuxt server it gives me an (401) Unauthorized error

TL;DR
The user is seeking help in accessing the session on the Nuxt server side. They mention the appwrite-ssr npm package as a potential solution. However, it is mentioned that using SSR is not recommended at the moment. There is no definitive solution provided in the thread.
Tessa
19 Oct, 2023, 18:05

@VincentGe can you look into this?

VincentGe
19 Oct, 2023, 18:07

We don't support SSR right now, there are some hacky workarounds, but we're working on better SSR suppor.t

VincentGe
19 Oct, 2023, 18:07

At the moment, I would just recommend not using SSR

VincentGe
19 Oct, 2023, 18:07

😅

VincentGe
19 Oct, 2023, 18:07

It's a know product limitation

leonardorick
21 Oct, 2023, 20:35

[ANSWERED] Access session on nuxt server side

otik
21 Oct, 2023, 20:43

Maybe appwrite-ssr npm package could help

Drake
21 Oct, 2023, 21:15

[CLOSED] Access session on nuxt server side

Reply

Reply to this thread by joining our Discord

Reply on Discord

Need support?

Join our Discord

Get community support by joining our Discord server.

Join Discord

Get premium support

Join Appwrite Pro and get email support from our team.

Learn more