Hello, I’m using Appwrite to authenticate a user and then retrieve their IP address. However, when I try to get the user's IP address, it seems to return the server's IP address instead of the actual user's IP address.
Here’s the issue:
I authenticate the user using Appwrite. I use the locale.get() function to retrieve the user's IP address. However, the IP address returned points to the server's location, not the actual user's. Has anyone encountered this issue? Any suggestions on how to fix this?
` const userClient = new Client()
.setEndpoint('https://cloud.appwrite.io/v1')
.setProject('project')
.setJWT(req.headers['x-appwrite-user-jwt']);
const account = new Account(userClient);
const user = await account.get();
const userId = user.$id;
if (userId) {
const locale = new Locale(userClient);
const result = await locale.get();
return res.json(result, 200);
}`
response: {
"ip": "138.68.98.28",
"countryCode": "DE",
"country": "Germany",
"continentCode": "EU",
"continent": "Europe",
"eu": true,
"currency": ""
}
Recommended threads
- router_deployment_not_found
I updated my function a few times and now i am getting the error: router_deployment_not_found I even reverted back to my original code but i am still getting th...
- Cloud function deploy stucks in processi...
Been trying for the last hours to deploy my function but for whatever reason, alwasy stuck on processing!
- [SOLVED] curl error Number: 6 — function...
Hello, I invested a lot of time in this error in a fresh install of appwrite 1.8.1 and lasted until fix, this if for helping anyone that can have the same weird...