Fixed Wrong IP being loged
This commit is contained in:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user