SECURITY FIXES: - SEC-1: Debug-Endpoints (/api/debug/*) entfernt - waren ohne Auth zugänglich - SEC-2: debugCode aus 2FA API-Responses entfernt (nur noch console.log in dev) - SEC-3: Session Secret Validierung - Server startet nicht ohne SECRET in production - SEC-4: 2FA if(true) bypass entfernt - 2FA-Flow funktioniert jetzt korrekt - SEC-5: Auth-Checks auf 10 Endpoints hinzugefügt (labels, notes, goals, rewards) BUG FIXES: - DUP-1: Doppelte DELETE /api/tasks/:id Route entfernt - DUP-2: Doppelter deleteLabel() Aufruf entfernt - DEAD-4: PATCH /api/goals/:id nutzt jetzt updateGoal() statt updateTask() - MISC-3: XP Double-Counting in logXpEvent() behoben - TYPE-2: awardXP() Parameter-Reihenfolge korrigiert (break, energy, focus) - DEAD-1: Ungenutzter calculateXP() Dead Code entfernt
This commit is contained in:
+2
-4
@@ -1043,10 +1043,8 @@ export class DbStorage implements IStorage {
|
||||
|
||||
async logXpEvent(event: InsertXpEvent): Promise<XpEvent> {
|
||||
const result = await this.db.insert(schema.xpEvents).values(event).returning();
|
||||
// Also update user XP
|
||||
if (event.userId) { // In real app ensure ID
|
||||
await this.updateUserXP(event.userId, event.amount);
|
||||
}
|
||||
// BUG FIX: Removed duplicate updateUserXP call (MISC-3)
|
||||
// XP is already updated in GamificationService.awardXP() before logXpEvent is called
|
||||
return result[0];
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user