appwrite-ssr-next-js icon indicating copy to clipboard operation
appwrite-ssr-next-js copied to clipboard

How to make sure the session object remains accurate when using ssr?

Open ghost opened this issue 2 years ago • 3 comments

Right now, when an API route is used to proxy the user login process, it doesn't look like the session object that'll be retrieved when I call appwrite's getSession endpoint will return the expected values, since I'm not directly making the request from the user's browser. Details like deviceModel and deviceBrand will be incorrect. Is there a way to make this work, since it's an issue with the user agent?

ghost avatar May 27 '23 09:05 ghost

Can I just pass a custom "user-agent" header?

ghost avatar May 27 '23 10:05 ghost

Correct, you can pass custom headers. That sounds like a proper solution, to also proxy some headers such as user-agent or forwarded IP.

Meldiron avatar May 28 '23 09:05 Meldiron

Okay, I'll try that out soon

ghost avatar May 28 '23 09:05 ghost