Back

Accessing Cookies from localhost

  • 0
  • Web
  • Cloud
Drake
29 Aug, 2023, 03:11

What are you doing that results in this?

TL;DR
User is experiencing issues with accessing cookies from localhost. They initially tried changing the hostname, but the browser didn't accept it. They then discovered that the latest update supports HTTPS in development, which would be helpful for testing authentication locally. They encountered two errors when setting a custom domain and had to update the Google API console with the new Appwrite endpoints. They resolved these issues by referring to code from the almostSSR repo. The user eventually got it to work after two days. The error they are currently facing is related to accessing the Appwrite API through localhost. The issue might be due to a 3rd party cookie problem, so
Shinobi
29 Aug, 2023, 03:13

i trying to call the account.get() function

Shinobi
29 Aug, 2023, 03:13
Drake
29 Aug, 2023, 03:14

How did you initialize the client?

Shinobi
29 Aug, 2023, 03:16

yes, when i used the https://cloud.appwrite.io/v1 endpoint it works perfectly but when i used http://appwrite.shinobi.com:3000/ it gets that error

Drake
29 Aug, 2023, 03:17

Right...because you need the v1. What happens when you have the v1?

Shinobi
29 Aug, 2023, 03:20

the same thing I guess it happening because the custom domain isn't verified

Shinobi
29 Aug, 2023, 03:20
Shinobi
29 Aug, 2023, 03:21

appwrite is still providing this endpoint

Drake
29 Aug, 2023, 03:25

The custom domain won't verify if your domain isn't publicly accessible. It doesn't matter, though.

Drake
29 Aug, 2023, 03:25

That will show whatever you're accessing appwrite on

Shinobi
29 Aug, 2023, 03:28

ok

Shinobi
30 Aug, 2023, 17:09

hey again, I managed to get a custom domain and changed the API endpoint so most of the errors went away but I'm still running into this error evertime I'm run account.get()

Shinobi
30 Aug, 2023, 17:09
Shinobi
30 Aug, 2023, 17:14

Wait I think its because I'm trying to access the appwrite API through localhost

Shinobi
30 Aug, 2023, 17:15
Drake
30 Aug, 2023, 17:27

right. it's probably a 3rd party cookie problem. either enable 3rd party cookies in your browser settings or set up a fake domain by editing your hosts file

Shinobi
31 Aug, 2023, 02:38

after 2 days i finally got it to work🥳

Shinobi
31 Aug, 2023, 02:39

thanks a lot for your advice and patience @Steven @kathelia.dokgu

Drake
31 Aug, 2023, 02:42

No problem! What did you do?

Shinobi
31 Aug, 2023, 02:52

after I set the custom domain I ran into two errors:

  1. Running the client SDK on the SSR pages
  2. I forgot to update the Google API console with the new Appwrite endpoints

After I did that it was just copying code from the almostSSR repo(which most of it I don't understand but it worked lol)

Shinobi
31 Aug, 2023, 02:53

I'm going to write an article about this process in a few days

Shinobi
6 Oct, 2023, 19:20

In the latest next 13 update it now supports HTTPS in development which should be helpful in testing auth locally

Shinobi
6 Oct, 2023, 19:21
Shinobi
7 Oct, 2023, 15:13

update: it doesn't work if you change the hostname. The browser won't accept it for some reason

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