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
- Local appwrite run functions --user-id n...
Hi, I'm running into an issue when testing Appwrite functions locally with user impersonation. I'm using a self-hosted Appwrite instance and running functions ...
- Function domain not available
Hello, even tho in docs you clearly describe that every function has its domain, I can not see it anywhere in any of my projects. How do I reveal the url of th...
- Inquiry: How to Reduce Cold Start Durati...
Hey! I was using Python for the function runtime, but after reading that Go has the fastest runtime, I switched my code over to Go. However, I'm still seeing co...