${this.event.clientIp || t`-`}
- ${geo
- ? html`
${[geo.city, geo.country].join(", ")}`
- : html``}
+
${EventGeo(this.event)}
diff --git a/web/src/admin/events/utils.ts b/web/src/admin/events/utils.ts
index 7810b94d1..27e3f921e 100644
--- a/web/src/admin/events/utils.ts
+++ b/web/src/admin/events/utils.ts
@@ -1,7 +1,24 @@
+import { EventWithContext } from "@goauthentik/common/events";
+import { KeyUnknown } from "@goauthentik/elements/forms/Form";
+
import { t } from "@lingui/macro";
+import { TemplateResult, html } from "lit";
+
import { EventActions } from "@goauthentik/api";
+export function EventGeo(event: EventWithContext): TemplateResult {
+ let geo: KeyUnknown | undefined = undefined;
+ if (Object.hasOwn(event.context, "geo")) {
+ geo = event.context.geo as KeyUnknown;
+ const parts = [geo.city, geo.country, geo.continent].filter(
+ (v) => v !== "" && v !== undefined,
+ );
+ return html`${parts.join(", ")}`;
+ }
+ return html``;
+}
+
export function ActionToLabel(action?: EventActions): string {
if (!action) return "";
switch (action) {