Fixed Wrong IP being loged

This commit is contained in:
PxlLoewe
2026-02-01 11:45:18 +01:00
parent cc29ac3e14
commit 824d2e40a9
7 changed files with 135 additions and 13 deletions

View File

@@ -102,8 +102,13 @@ export const ProfileForm = ({
userId: user.id,
});
}
const ip = await fetch("https://api.ipify.org/?format=json")
.then((res) => res.json())
.then((data) => data.ip);
if (user.firstname !== values.firstname) {
await logAction("PROFILE_CHANGE", {
ip,
field: "firstname",
oldValue: user.firstname,
newValue: values.firstname,
@@ -111,6 +116,7 @@ export const ProfileForm = ({
}
if (user.lastname !== values.lastname) {
await logAction("PROFILE_CHANGE", {
ip,
field: "lastname",
oldValue: user.lastname,
newValue: values.lastname,
@@ -118,6 +124,7 @@ export const ProfileForm = ({
}
if (user.email !== values.email) {
await logAction("PROFILE_CHANGE", {
ip,
field: "email",
oldValue: user.email,
newValue: values.email,