Commit Graph

4 Commits

Author SHA1 Message Date
Simon b2de630983 harden security: enforce JWT_SECRET, helmet, CSP, stricter rate limits
- Require JWT_SECRET env var (fatal exit if missing)
- Add helmet middleware with custom CSP
- Cookie Secure flag when NODE_ENV=production
- requireAuth re-verifies user.status from DB on every request
- class_events DELETE restricted to creator or admin
- Rate limit /register (5/hr) and PUT /me/password (5/15min)
- Password minimum 6 to 8 chars
- crudRoutes truncates strings to 1000 chars
- Remove application/octet-stream from allowed upload MIMEs
2026-04-17 23:40:27 +02:00
Simon 8f75bc6a10 feat: add TOTP 2FA with QR code and manual secret entry 2026-04-17 22:56:39 +02:00
Simon ae789318ba feat: add teacher system with approval flow
- Teacher registration requires subject selection; account starts pending
- Admin approves/rejects via existing admin panel
- Teacher panel (Materialien, Ankündigungen, Prüfungen, Noten) visible only to approved teachers
- Students see class materials and announcements via sidebar overlays
- Teachers can assign grades to students (scoped to own subject)
- New tables: teacher_materials, teacher_announcements, teacher_exams, teacher_assigned_grades
- subject column added to users; included in JWT and /api/me
- requireTeacher middleware fetches fresh status+subject from DB on every request
- Login hint: username is the part of the school email before the @
2026-04-17 10:00:09 +02:00
Simon db5efd8ed9 clean initial commit 2026-04-17 00:12:47 +02:00