From 040ef4d45dfc11f84bdf03ddf1621c7ec5ee1319 Mon Sep 17 00:00:00 2001 From: Rafif Riqullah Siregar Date: Tue, 21 Jul 2026 14:16:50 +0700 Subject: [PATCH] fix(backend): remove duplicate mongoose index definition on expires_at --- backend/models/Session.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/backend/models/Session.js b/backend/models/Session.js index 2d63c27..29c8de8 100644 --- a/backend/models/Session.js +++ b/backend/models/Session.js @@ -11,7 +11,7 @@ const SessionSchema = new mongoose.Schema({ user_agent: { type: String, default: 'Unknown' }, session_token: { type: String, required: true, unique: true }, // JWT JTI or unique token hash last_active: { type: Date, default: Date.now }, - expires_at: { type: Date, required: true, index: true }, // MongoDB TTL Index will auto-expire sessions + expires_at: { type: Date, required: true }, // MongoDB TTL Index specified below via SessionSchema.index }, { timestamps: { createdAt: 'created_at', updatedAt: 'updated_at' } });