feat(admin): add geolocation information to user sessions and implement geo IP fetching
This commit is contained in:
@@ -19,6 +19,7 @@ import {
|
||||
CheckCircle2,
|
||||
Globe,
|
||||
LogIn,
|
||||
MapPin,
|
||||
Monitor,
|
||||
RefreshCw,
|
||||
Search,
|
||||
@@ -99,6 +100,10 @@ function SessionRow({ session }: { session: AdminUserSession }) {
|
||||
const isExpired = new Date(session.expiresAt) < new Date();
|
||||
const userAgent = session.userAgent ?? 'Desconocido';
|
||||
const ip = session.ipAddress ?? '—';
|
||||
const location =
|
||||
session.city || session.country
|
||||
? [session.city, session.country].filter(Boolean).join(', ')
|
||||
: null;
|
||||
|
||||
return (
|
||||
<div className="rounded-xl border border-border/60 p-4">
|
||||
@@ -126,6 +131,12 @@ function SessionRow({ session }: { session: AdminUserSession }) {
|
||||
<Globe className="size-3" />
|
||||
{ip}
|
||||
</span>
|
||||
{location && (
|
||||
<span className="flex items-center gap-1">
|
||||
<MapPin className="size-3" />
|
||||
{location}
|
||||
</span>
|
||||
)}
|
||||
<span className="flex items-center gap-1">
|
||||
<LogIn className="size-3" />
|
||||
{new Date(session.createdAt).toLocaleString()}
|
||||
|
||||
Reference in New Issue
Block a user