Back

auth via sessions on custom server

  • 1
  • Self Hosted
  • Accounts
  • Users
otik
4 May, 2023, 20:29

Hi, i am wondering, Is there any chance to authenticate user via access/refresh session tokens on my server? I can't use JWT because my server uses SSR (SvelteKit).

I have already figured out how to authenticate user via expired JWT and access/refresh session tokens, but it is litttle bit too sofisticated. BTW thank you for Appwrite, is awesome

TL;DR
The user is asking if it is possible to authenticate users via access/refresh session tokens on their server. They mention they cannot use JWT due to server-side rendering (SSR) with SvelteKit. They have already figured out a solution using expired JWTs and access/refresh session tokens, but find it complicated. They also express gratitude for Appwrite.
Drake
4 May, 2023, 22:35

Not really.

First of all, SSR makes things significantly more complicated. If you don't need it, i recommend turning it off.

If you need it and you want to have API calls made both on the client and server-side, you'd have to make sure the session cookie is shared between the client and the server. Take a look at https://svelte-kit.ssr.almostapps.eu/ for a demo.

otik
5 May, 2023, 06:42

Thank you very much

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