Hub 2.9.0: whether people can sign in

- An Events install's page shows its sign-in mode, whether it's linked to the church's Accounts,
  and the last sign-in failure (Events 3.5.0 heartbeat, contracts 1.13.0 vendored).
- Alerts: signs in through Accounts but isn't linked (critical), linked to the wrong Accounts, a
  sign-in failed in the last 24 hours, an Accounts nothing is linked to while the church has Events.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-11-20 12:56:41 +02:00
co-authored by Claude Opus 5.5
parent 1150a82ecc
commit 894f2b2771
12 changed files with 130 additions and 19 deletions
@@ -119,6 +119,27 @@ export default function InstallPage() {
<p className="mt-2 text-xs text-slate-500">{d.protocolVersion >= 2 ? "This site is told about the products listed to it in each heartbeat reply (Linked products), so it can connect to them." : "This site uses protocol 1 (Cross Events before 2.4), so it isn't told about the others yet."}</p>
</>
)}
{/* Hub 2.9.0: how people sign in (Events 3.5.0+ heartbeat), checked against the church's Accounts. */}
{d.summary.product === "events" && (
<div className="mt-3 border-t border-slate-100 pt-3">
{s.signIn ? (() => {
const si = s.signIn;
const accounts = d.siblings.find(x => x.product === "accounts");
const linkedOk = si.accounts && accounts && si.accounts.installId === accounts.id;
return (
<>
<Row k="Sign-in" v={si.mode === "accounts" ? "through Accounts" : "Cross Events' own"} />
<Row k="Linked to Accounts" v={
!si.accounts ? <span className={si.mode === "accounts" ? "font-medium text-red-700" : "text-slate-500"}>not linked{si.mode === "accounts" ? ": nobody can sign in" : ""}</span>
: linkedOk ? <span className="text-green-700">yes, the church&apos;s Accounts ({si.accounts.url})</span>
: <span className="text-amber-700">{si.accounts.url} — {accounts ? "not the church's Accounts on the Hub" : "the Hub has no Accounts for this church"}</span>
} />
<Row k="Last sign-in problem" v={si.lastError ? <span className="text-amber-800">{fmtDate(si.lastError.at)}: {si.lastError.code} — {si.lastError.message}</span> : "none"} />
</>
);
})() : <Row k="Sign-in" v={<span className="text-slate-500">not reported (Cross Events before 3.5.0)</span>} />}
</div>
)}
<div className="mt-3 border-t border-slate-100 pt-3">
<Row k="This site's public key" v={d.publicKey ? "saved" : d.protocolVersion >= 2 ? "none yet (saved with its next heartbeat)" : "none (protocol 1)"} />
{d.publicKey && (
+4
View File
@@ -68,6 +68,10 @@ export type Stats = {
campuses?: boolean;
campusCount?: number;
income?: { last30d?: string; allTime?: string; eventIncome12m?: string };
/** Cross Events 3.5.0+ (contracts 1.13.0): how people sign in. */
signIn?: { mode: "local" | "accounts"; accounts: { installId: string; url: string } | null; lastError: { at: string; code: string; message: string } | null };
/** Accounts: products linked to it. */
linkedProducts?: number;
};
export type InstallEvent = { id: string; type: string; level: Problem["level"]; message: string; createdAt: string; resolvedAt: string | null; install?: { id: string; name: string; url: string } };