Hi everyone,
I have a problem where, when a user logs in, the saved IP address is the server’s IP instead of the user’s real IP. I followed this guide: How to Run Appwrite Behind Nginx, but I’m not sure how to fix it.
I’m using a Next.js app with SSR for login and registration. Here’s my function for creating a session:
export async function createSessionClient(): Promise<AppwriteClient> {
const client = new Client()
.setEndpoint(process.env.NEXT_PUBLIC_APPWRITE_ENDPOINT!)
.setProject(process.env.NEXT_PUBLIC_APPWRITE_PROJECT!);
const cookieStore = await cookies();
const session = cookieStore.get("auth-session");
if (!session || !session.value) {
throw new Error("No session");
}
client.setSession(session.value);
return {
get account() {
return new Account(client);
},
};
}
How can I get the user’s real IP instead of the server’s IP? Any help would be really appreciated!
Thank you!
Recommended threads
- Cant get realtime working
Hey I nned some help with realtime a gain. I was using client.subscribe(...), and i found out that its depricated then i believe realtime.subscribe(...) is the ...
- Firebase app import
I'm **very** new to appwrite and I just set up appwrite with docker and I'm trying to import a Firebase app I have set up but it's erroring and I don't really k...
- Console infinite loading behind NginxPro...
Hi All, I am trying to get AppWrite to work behind NPM. I've followed the Medium guide to set proper headers, I've added my proxy configuration to NPM, and I ...