Guys, is there any approach to get current logged account from the server-side?
Developing with Nextjs
get logged user from server-side [NextJs]
get logged user from server-side - NextJs
Check out the Users api https://appwrite.io/docs/references/cloud/server-nodejs/users#get
That wouldn’t help with “getting the currently logged in user”.
do you really need SSR?
Yes, I really do. I need it to get the author of a 'creation'. I mean, when someone create a post I need to get its account_id to set has the author of that post all of that in SSR
but why do you need SSR? Why not turn off SSR and do it client side?
It’s a personal choice, I’m new to the dev world. I think SSR is faster and more secure than CSR.
Also, using SSR will make it easier for me to redirect to the login page before fully loading the homepage. I’m developing my app using Next.js
honestly, especially if you're new, i recommend staying away from SSR because it adds complexity.
if you really want to continue using SSR, you'll either need to use JWT tokens or manually create a session server side so you can extract the session cookie from the header and fully manage it yourself (demo: https://next-js.ssr.almostapps.eu/).
We do have plans to improve SSR with Appwrite which can be found here: https://github.com/appwrite/rfc/pull/59
I’ll take on SSR, who knows, maybe with this challenge I’ll learn faster 😅 . Thank you for the tips, I’ll take a look.
Recommended threads
- Paused project can't activate
I have failed to reactivate one my projects which had been paused
- Site deployment keeps getting failed
Hi good folks, need a hand with Sites deploy Error on every deploy: Synchronous function execution timed out... duration doesn't exceed 30 seconds [exact log ...
- Unknown attribute type: varchar / text
Since the `string` type is deprecated I tried using `varchar` and `text` in some newer tables, but when running `appwrite pull tables && appwrite types ./src/li...