Clean up code found in the audit

- Replace every em-dash in src and server/src with a colon, comma or hyphen
- Give every relative import its file extension (.jsx imports of .tsx fixed)
- Delete old-historyMock.ts, unused exports, unused CSS utilities, the
  unused @ alias and the fallback option nothing passed
- One copy each of initials, capitalize, byName and the server's marks()
- Move the organization, chapter and event hooks from src/data to src/lib
- Schema sync always throws on a mismatch (strict was never turned off)
- Replace the placeholder README

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Zaldimmar 2026-09-28 22:02:03 -05:00
parent 4066e9ec61
commit 5274e09571
75 changed files with 282 additions and 688 deletions

View file

@ -28,7 +28,7 @@
The list comes from auth.js rather than being repeated here, so
the CLI can't drift from what requireRole will actually accept.
This is also how the first superadmin is made — there's no
This is also how the first superadmin is made, there's no
bootstrap path in the web interface, on purpose:
node src/admin-cli.js role you@ngu.org superadmin
@ -82,7 +82,7 @@ async function readPassword() {
if (first === "") {
const generated = randomBytes(12).toString("base64url");
console.log(`\nGenerated password: ${generated}`);
console.log("Copy it now — it isn't stored anywhere readable.\n");
console.log("Copy it now, it isn't stored anywhere readable.\n");
return generated;
}
@ -116,7 +116,7 @@ function checkRole(role) {
return role;
}
/* Printed, never enforced — see the note at the top of the file.
/* Printed, never enforced, see the note at the top of the file.
Worth saying out loud, because the person doing it is usually
tidying up accounts rather than thinking about lockouts. */
function warnIfLastSuper(db, user) {
@ -183,7 +183,7 @@ function setRole(db, email, role) {
db.prepare("UPDATE admin_users SET role = ? WHERE id = ?").run(role, user.id);
// The session they're holding was issued against the old role.
// Every check reads the row fresh, so it isn't a security hole —
// Every check reads the row fresh, so it isn't a security hole,
// but their open tab would keep drawing buttons that now 403.
destroyAllSessionsFor(db, user.id);