Skip to Content
IssuesStrategy Timeline Shows "Unknown" for Client Actions

Strategy Timeline Shows “Unknown” for Client Actions

Status: ✅ Fixed (2026-05-06)
Affected area: Strategy timeline, any StrategyLog.performedBy written from dashboard server actions

Symptom

The strategy timeline showed “Unknown” as the actor for all client-triggered events (approvals, revision requests, budget changes) even when the logged-in user was known.

Root Cause

AccessTokenPayload in apps/api/src/jwt.ts only carried sub, tenantId, role, appAccess — no name field.

requireSession() in apps/dashboard/src/lib/server-auth.ts builds user.name as:

name: name ?? email ?? "Unknown"

Since neither name nor email was included in the JWT, user.name was always "Unknown". Server actions then stored that string as performedBy in StrategyLog.

Fix

  1. Added name?: string to AccessTokenPayload interface in apps/api/src/jwt.ts
  2. Updated all three signAccessToken calls in apps/api/src/routers/auth.ts to include the user’s name:
    • Login: name: user.name ?? undefined
    • Token refresh: name: user.name ?? undefined
    • Registration: name: `${firstName} ${lastName}`.trim()

DashboardPayloadSchema already had name: z.string().optional() — no schema change was needed.

Note

Existing log rows written before this fix permanently show “Unknown”. Users must log out and back in to get a token that includes their name.

© 2026 Leadmetrics — Internal use only