diff --git a/web-next/app/[locale]/security-history/page.tsx b/web-next/app/[locale]/security-history/page.tsx
index 06f32d7..a87d5d7 100644
--- a/web-next/app/[locale]/security-history/page.tsx
+++ b/web-next/app/[locale]/security-history/page.tsx
@@ -3,6 +3,7 @@ import { setRequestLocale } from 'next-intl/server'
import { redirect } from '@/i18n/navigation'
import { getSession } from '@/lib/session'
import { getSecurityHistory } from '@/lib/security-history'
+import { wowAccountLabel } from '@/lib/bnet'
import { PageShell } from '@/components/PageShell'
import { ServiceBox } from '@/components/ServiceBox'
@@ -16,6 +17,21 @@ function fmt(d: Date): string {
return `${p(d.getHours())}:${p(d.getMinutes())}:${p(d.getSeconds())} ${p(d.getDate())}-${p(d.getMonth() + 1)}-${d.getFullYear()}`
}
+/** Celda «Usuario»: cuenta de juego (WOW1) + cuenta Battle.net (email) debajo. */
+function UserCell({ label, bnet }: { label: string; bnet: string }) {
+ return (
+
+ {label}
+ {bnet && (
+ <>
+
+ {bnet}
+ >
+ )}
+ |
+ )
+}
+
export default async function SecurityHistoryPage({ params }: { params: Promise<{ locale: string }> }) {
const { locale } = await params
setRequestLocale(locale)
@@ -24,8 +40,9 @@ export default async function SecurityHistoryPage({ params }: { params: Promise<
if (!session.bnetId) redirect({ href: '/login', locale })
if (!session.username) redirect({ href: '/select-account', locale })
- const displayUser = session.username || session.bnetEmail || '—'
- const { activity, realm, web } = await getSecurityHistory(session.accountId!, displayUser, session.bnetEmail || '')
+ const bnetEmail = session.bnetEmail || ''
+ const displayUser = wowAccountLabel(session.username || '') // «15#1» → «WOW1»
+ const { activity, realm, web } = await getSecurityHistory(session.accountId!, displayUser, bnetEmail)
return (
@@ -84,9 +101,7 @@ export default async function SecurityHistoryPage({ params }: { params: Promise<
{activity.map((a, i) => (
- |
- {a.user}
- |
+
{a.action}
|
@@ -170,9 +185,7 @@ export default async function SecurityHistoryPage({ params }: { params: Promise<
{web.map((c, i) => (
- |
- {c.user}
- |
+
{c.status}
|
diff --git a/web-next/lib/bnet.ts b/web-next/lib/bnet.ts
index a4e3b19..89d0673 100644
--- a/web-next/lib/bnet.ts
+++ b/web-next/lib/bnet.ts
@@ -146,3 +146,13 @@ export function normalizeEmail(email: string): string {
export function makeGameAccountUsername(bnetId: number, index = 1): string {
return `${bnetId}#${index}`
}
+
+/**
+ * Nombre visible de una cuenta de juego: «15#1» → «WOW1» (el nº tras # es la
+ * cuenta de juego bajo la Battle.net; con varias serían WOW1, WOW2, WOW3…).
+ * El «15» es el id de la cuenta Battle.net y no debe mostrarse al usuario.
+ */
+export function wowAccountLabel(username: string): string {
+ const i = username.indexOf('#')
+ return i >= 0 ? `WOW${username.slice(i + 1)}` : username
+}