DD-011: make Google login the only way in
Remove the free player selection from /benvenuto: without a Supabase session no screen renders, and the VITE_AUTH_OBBLIGATORIA bridge flag is gone. Admin rights now come only from user_roles, so the hardcoded name list in crapp-data.ts is deleted along with its tests. Add migration m4_solo_autenticati, which revokes anon access to the v1.0 tables. Apply it only once the whole team has linked an account. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
@@ -1,14 +1,6 @@
|
||||
/** Check dei dati di base della rosa: `bun test/unit/crapp-data.test.ts`. */
|
||||
import assert from "node:assert/strict";
|
||||
import {
|
||||
adminNomi,
|
||||
classifica,
|
||||
formatData,
|
||||
giocatori,
|
||||
isAdmin,
|
||||
statoMeta,
|
||||
storicoMatch,
|
||||
} from "@/lib/crapp-data";
|
||||
import { classifica, formatData, giocatori, statoMeta, storicoMatch } from "@/lib/crapp-data";
|
||||
|
||||
// --- rosa --------------------------------------------------------------------
|
||||
assert.ok(giocatori.length > 0, "la rosa non è vuota");
|
||||
@@ -32,17 +24,6 @@ for (const g of giocatori) {
|
||||
assert.ok(g.presenze <= g.totaliEventi, `${g.id}: presenze mai oltre gli eventi totali`);
|
||||
}
|
||||
|
||||
// --- amministratori ----------------------------------------------------------
|
||||
for (const nome of adminNomi) {
|
||||
const admin = giocatori.find((g) => g.nome === nome);
|
||||
assert.ok(admin, `l'amministratore ${nome} è in rosa`);
|
||||
assert.equal(isAdmin(admin.id), true);
|
||||
}
|
||||
const nonAdmin = giocatori.find((g) => !adminNomi.includes(g.nome))!;
|
||||
assert.equal(isAdmin(nonAdmin.id), false);
|
||||
assert.equal(isAdmin("g999"), false, "un id inesistente non è amministratore");
|
||||
assert.equal(isAdmin(""), false);
|
||||
|
||||
// --- formatData --------------------------------------------------------------
|
||||
assert.equal(formatData("2026-09-01"), "mar 01 settembre");
|
||||
assert.equal(formatData("2026-01-31"), "sab 31 gennaio");
|
||||
|
||||
Reference in New Issue
Block a user