AppView in a box as a Vite plugin thing hatk.dev
2
fork

Configure Feed

Select the types of activity you want to include in your feed.

fix: include viewer handle in 401 redirect for seamless re-auth

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

+1 -1
+1 -1
packages/hatk/src/cli.ts
··· 1843 1843 if (procedureNsids.length > 0) { 1844 1844 clientOut += ` if (_procedures.has(nsid)) {\n` 1845 1845 clientOut += ` const res = await _fetch(path, { method: 'POST', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify(arg) })\n` 1846 - clientOut += ` if (typeof window !== 'undefined' && res.status === 401) { window.location.href = '/oauth/login'; return new Promise(() => {}) as any }\n` 1846 + clientOut += ` if (typeof window !== 'undefined' && res.status === 401) { const _h = getViewer()?.handle; window.location.href = _h ? \`/oauth/login?handle=\${encodeURIComponent(_h)}\` : '/oauth/login'; return new Promise(() => {}) as any }\n` 1847 1847 clientOut += ` if (!res.ok) throw new Error(\`XRPC \${nsid} failed: \${res.status}\`)\n` 1848 1848 clientOut += ` return res.json() as Promise<OutputOf<K>>\n` 1849 1849 clientOut += ` }\n`