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
- Added
name?: stringtoAccessTokenPayloadinterface inapps/api/src/jwt.ts - Updated all three
signAccessTokencalls inapps/api/src/routers/auth.tsto include the user’s name:- Login:
name: user.name ?? undefined - Token refresh:
name: user.name ?? undefined - Registration:
name: `${firstName} ${lastName}`.trim()
- Login:
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.