Back

[SOLVED] locale API

  • 1
  • Locale
  • Cloud
otik
18 Aug, 2023, 11:16

Hi, please i have maybe weird question. When i am using locale.get() it returns me my IP when i am on localhost. But when it is in production it returns IP of server that hosts it (vercel). I thought that it uses JWT to get IP of user, but it only returns IP of server that is requesting, is it right? Or am i doing something wrong? I know, i can call it on client-side, but i am using sveltekit(SSR). BTW i call locale.get() on server-side with JWT.

TL;DR
The user is encountering an issue where the `locale.get()` function is returning the server IP instead of the user's IP when the application is in production. They are using SvelteKit (SSR) and calling the function on the server-side with JWT authentication. They were expecting the `locale.get()` function to use JWT to get the user's IP but it only returns the server IP. The user is wondering if they are doing something wrong. Solution: The `locale.get()` function only returns the user's IP when called on the client-side SDK, not the server-side. In this case, since the function is called on
Binyamin
18 Aug, 2023, 12:51

Locale.get will give you the user IP only from the client side SDK

Binyamin
18 Aug, 2023, 12:52

JWT will authenticate on behalf of the user but it will still execute from the server therefore you'll get the server IP

otik
18 Aug, 2023, 14:54

Thank you very much

Drake
18 Aug, 2023, 15:50

[SOLVED] locale API

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