import { getMemberToken, getApiBaseUrl } from '../_lib/api'; import Link from 'next/link'; interface MemberProfile { id: string; tenantId: string; jid: string; displayName: string | null; createdAt: string; } async function fetchProfile(token: string): Promise { const res = await fetch(`${getApiBaseUrl()}/my/profile`, { headers: { Accept: 'application/json', Authorization: `Bearer ${token}` }, cache: 'no-store', }).catch(() => null); if (!res || !res.ok) return null; return (await res.json()) as MemberProfile; } export default async function MyPage() { const token = await getMemberToken(); if (!token) { return (

Member portal

No member session. Complete onboarding via the link a group admin sent you.

); } const profile = await fetchProfile(token); if (!profile) { return (

Couldn't load your account

Your session may have expired. Please complete onboarding again.

); } return (

Your account

Display name:
{profile.displayName ?? '—'}
JID:
{profile.jid}
Joined:
{new Date(profile.createdAt).toLocaleDateString()}
Manage your groups → Privacy & account settings →
); }