also looking at this
Harden AnalyticsHQ release and dashboard quality
#52
34 files
+1236
-340
| @@ -89,11 +89,11 @@ const roleLabel = invite?.role === 'admin' ? 'view the reports and change settin | ||
| 89 | 89 | // Round-trips the reader back here after they sign in or register. |
| 90 | 90 | const returnTo = `/invite?token=${encodeURIComponent(token)}` |
| 91 | 91 | |
| 92 | // The token is the only thing that crosses. Everything else this block resolved | |
| 92 | // The capability is the only thing that crosses. Everything else this block resolved | |
| 93 | 93 | // — the invite row, the viewer, the refusal — stays server-side: the client has |
| 94 | 94 | // no decision to make, it only posts the token back for the server to re-check. |
| 95 | const inviteToken = token | |
| 96 | defineClientPayload({ inviteToken }) | |
| 95 | const inviteCapability = token | |
| 96 | defineClientPayload({ inviteCapability }) | |
| 97 | 97 | </script> |
| 98 | 98 | |
| 99 | 99 | <script client> |
| @@ -110,7 +110,7 @@ async function accept(): Promise<void> { | ||
| 110 | 110 | const res = await session.authFetch('/api/invites/accept', { |
| 111 | 111 | method: 'POST', |
| 112 | 112 | headers: { 'content-type': 'application/json' }, |
| 113 | body: JSON.stringify({ token: inviteToken }), | |
| 113 | body: JSON.stringify({ token: inviteCapability }), | |
| 114 | 114 | }) |
| 115 | 115 | const d = await res.json().catch(() => ({})) |
| 116 | 116 | if (res.ok && d.siteId) { |