diff --git a/apps/hub/app/(app)/admin/user/[id]/_components/AccountLog.tsx b/apps/hub/app/(app)/admin/user/[id]/_components/AccountLog.tsx index d39c4493..a12a4cc5 100644 --- a/apps/hub/app/(app)/admin/user/[id]/_components/AccountLog.tsx +++ b/apps/hub/app/(app)/admin/user/[id]/_components/AccountLog.tsx @@ -12,16 +12,20 @@ export const AccountLog = ({ sameIPLogs, userId }: { sameIPLogs: Log[]; userId: const tableRef = useRef(null); return (
-
-

- Account Log -

-

- Hier werden Logs angezeigt, die dem Nutzer zugeordnet sind oder von der selben IP stammen. -

-
+

+ Account Log +

+

+ Hier werden Logs angezeigt, die dem Nutzer zugeordnet sind oder von der selben IP + stammen. +

+
+ } rightOfPagination={
{ return { AND: [ + onlyImportant + ? { + type: { + in: ["REGISTER", "PROFILE_CHANGE"], + }, + } + : {}, { - OR: [ + AND: [ { ip: { contains: searchTerm } }, { browser: { contains: searchTerm } }, { @@ -58,24 +69,6 @@ export const AccountLog = ({ sameIPLogs, userId }: { sameIPLogs: Log[]; userId: }, ], }, - onlyImportant - ? { - OR: [ - { - id: { - in: sameIPLogs - .filter((log) => log.id.toString().includes(searchTerm)) - .map((log) => log.id), - }, - }, - { - type: { - in: ["REGISTER", "PROFILE_CHANGE"], - }, - }, - ], - } - : {}, ], } as Prisma.LogWhereInput; }} diff --git a/apps/hub/app/(auth)/login/_components/action.ts b/apps/hub/app/(auth)/login/_components/action.ts index 155a1ebc..dc120a02 100644 --- a/apps/hub/app/(auth)/login/_components/action.ts +++ b/apps/hub/app/(auth)/login/_components/action.ts @@ -35,6 +35,8 @@ export const logAction = async ( const headersList = await headers(); const user = await getServerSession(); + console.log(Array.from(headersList.entries())); + const ip = headersList.get("X-Forwarded-For") || headersList.get("Forwarded") ||