--- import '../styles.css' import { getSession } from '../lib/session' import { getOAuthClient } from '../lib/context' import { Agent } from '@atproto/api' const session = getSession(Astro.cookies) const oauthClient = getOAuthClient(Astro.cookies) let agent: Agent | null = null let profile: any = null if (session.did) { try { const oauthSession = await oauthClient.restore(session.did) if (oauthSession) { agent = new Agent(oauthSession) try { const profileResponse = await agent.app.bsky.actor.getProfile({ actor: agent.assertDid, }) profile = profileResponse.data } catch (err) { console.warn('Failed to fetch profile:', err) } } } catch (err) { console.warn('OAuth restore failed:', err) session.destroy() } } const displayName = profile?.displayName || agent?.assertDid || 'User' const handle = profile?.handle || agent?.assertDid || '' const avatar = profile?.avatar const description = profile?.description ---
{displayName}
{handle}
{description && ({description}
)}