+93
CRUSH.md
+93
CRUSH.md
···Development workflow: `bun dev` runs the server with hot module reloading. Changes to TypeScript, HTML, or CSS files automatically reload.·········
···Development workflow: `bun dev` runs the server with hot module reloading. Changes to TypeScript, HTML, or CSS files automatically reload.···+3. **Drop indexes before dropping columns** - SQLite will error if you try to drop a column with an index still attached······
+31
scripts/make-admin.ts
+31
scripts/make-admin.ts
···
···
+17
src/components/auth.ts
+17
src/components/auth.ts
·········
·········
+11
src/db/schema.ts
+11
src/db/schema.ts
···
+84
-1
src/index.ts
+84
-1
src/index.ts
··················
··················
+128
-3
src/lib/auth.ts
+128
-3
src/lib/auth.ts
··················
··················
+2
src/lib/errors.ts
+2
src/lib/errors.ts
+10
src/lib/middleware.ts
+10
src/lib/middleware.ts
+642
src/pages/admin.html
+642
src/pages/admin.html
···
···+href="data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'><text y='0.9em' font-size='90'>🪻</text></svg>">+src="https://hostedboringavatars.vercel.app/api/marble?size=32&name=${t.user_id}&colors=2d3142ff,4f5d75ff,bfc0c0ff,ef8354ff"+src="https://hostedboringavatars.vercel.app/api/marble?size=32&name=${u.avatar}&colors=2d3142ff,4f5d75ff,bfc0c0ff,ef8354ff"+<button class="delete-user-btn" data-user-id="${u.id}" data-user-email="${u.email}">Delete</button>+const isDemotingSelf = userEmail === currentUserEmail && oldRole === 'admin' && newRole === 'user';+if (!confirm('⚠️ WARNING: You are about to demote yourself from admin to user. You will lose access to this admin panel immediately. Are you sure?')) {+if (!confirm('⚠️ FINAL WARNING: This action cannot be undone by you. Another admin will need to restore your admin access. Continue?')) {+if (!confirm(`Are you sure you want to delete user ${userEmail}? This will delete all their transcriptions and cannot be undone.`)) {