Hello everyone, i'm having trouble understanding how to set the auth enviroment in dev(localhost). My idea is to get that cookie saved and use it to make request to appwrite using SSR setting the cookie manually in the request headers.
1- web sdk -> no cookies get saved, only the local storage fallback. 2-rest api -> the cookie gets set with the domain ".cloud.appwrite.io" but as soon as i refresh the page it gets deleted, i asume is something related to the domain.
So my question is how do i make the cookies get set and persisted in localhost dev?
At the moment i don't have a custom domain to set that up. I did create a web app in the appwrite console with the hostname localhost.
sorry to bother again, anyone has an example of how to implement it? thanks
You could try to modify your hosts file since you don't have a domain.
What framework are you using?
newbiew here, what would i need to include in the host file? i'm using sveltekit
Search online about hosts files
As for svelte, check out this demo: https://svelte-kit.ssr.almostapps.eu/
okey, i for sure need to learn more about it. i tried setting the local host to this domain ".cloud.appwrite.io" but didnt work. that would be the correct one to include?
You can't have the same domain (localhost) pointed at 2 different things
ohh, i will look into it. thanks for the help
i will add my two cents, i hope you don't mind. maybe it's me that is the complete newbie but it would be helpful if in the docs would say something about this and maybe provide an example on how to handle it. thanks again for the help and love appwrite!
Usually, I advise against SSR because it's very complicated.
Recommended threads
- Update User Error
```ts const { users, databases } = await createAdminClient(); const session = await getLoggedInUser(); const user = await users.get(session.$id); if (!use...
- apple exchange code to token
hello guys, im new here 🙂 I have created a project and enabled apple oauth, filled all data (client id, key id, p8 file itself etc). I generate oauth code form...
- How to Avoid Double Requests in function...
I'm currently using Appwrite's `functions.createExecution` in my project. I want to avoid double requests when multiple actions (like searching or pagination) a...