diff --git a/app/logs/page.tsx b/app/logs/page.tsx index c108a33..1268342 100644 --- a/app/logs/page.tsx +++ b/app/logs/page.tsx @@ -24,6 +24,7 @@ interface LogEntry { keyId: string; uid?: string | null; granted: boolean; + accessType: "oidc" | "mobile" | "physical"; } interface LogsResponse { @@ -342,8 +343,8 @@ function LogsPageInner() { Door Username Name - Keys - Access + Access method + Access @@ -351,19 +352,31 @@ function LogsPageInner() { {formatTimestamp(entry.timestamp)} - {entry.doorName ?? {entry.door}} + {entry.doorName ?? {entry.door}} - {entry.username ?? unknown} + {entry.username ?? unknown} - {entry.name ?? -} + {entry.name ?? -} - {entry.uid === undefined ? ( - - - ) : entry.uid === null ? ( - "Mobile Key" + {entry.accessType === "oidc" ? ( + "Remote Access" + ) : entry.accessType === "mobile" ? ( +
+
Mobile Key
+
+ ({entry.keyId}) +
+
+ ) : entry.accessType === "physical" ? ( +
+
Physical Key
+
+ ({entry.keyId}) +
+
) : ( - {entry.uid} + - )} @@ -383,7 +396,7 @@ function LogsPageInner() { className="card-footer d-grid align-items-center" style={{ gridTemplateColumns: "1fr auto 1fr" }} > - + Page {pageIndex + 1}  
@@ -402,4 +415,4 @@ export default function LogsPage() { ); -} \ No newline at end of file +} diff --git a/components/AuthGate.tsx b/components/AuthGate.tsx index 3614f38..87d974d 100644 --- a/components/AuthGate.tsx +++ b/components/AuthGate.tsx @@ -3,9 +3,9 @@ import { Container, Spinner } from "react-bootstrap"; import { useSession, signIn } from "next-auth/react"; import { AUTH_PROVIDER_ID, REFRESH_TOKEN_ERROR } from "@/lib/constants"; -import { useEffect } from "react"; +import { useEffect, type ReactNode } from "react"; -export default function AuthGate({ children }) { +export default function AuthGate({ children }: {children: ReactNode}) { const { data: session, status } = useSession({ required: true, onUnauthenticated() {