ReviewOS

also looking at this

stacks/analyticshq

Harden AnalyticsHQ release and dashboard quality

#52
Merged glennmichael123 wants to merge docs/bunpress-product-guide into main
34 files +1236 -340
resources/views/invite.stxmodified+4-4
Changes to resources/views/invite.stx
@@ -89,11 +89,11 @@ const roleLabel = invite?.role === 'admin' ? 'view the reports and change settin
8989// Round-trips the reader back here after they sign in or register.
9090const returnTo = `/invite?token=${encodeURIComponent(token)}`
9191
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
9393// — the invite row, the viewer, the refusal — stays server-side: the client has
9494// no decision to make, it only posts the token back for the server to re-check.
95const inviteToken = token
96defineClientPayload({ inviteToken })
95const inviteCapability = token
96defineClientPayload({ inviteCapability })
9797</script>
9898
9999<script client>
@@ -110,7 +110,7 @@ async function accept(): Promise<void> {
110110 const res = await session.authFetch('/api/invites/accept', {
111111 method: 'POST',
112112 headers: { 'content-type': 'application/json' },
113 body: JSON.stringify({ token: inviteToken }),
113 body: JSON.stringify({ token: inviteCapability }),
114114 })
115115 const d = await res.json().catch(() => ({}))
116116 if (res.ok && d.siteId) {