From 90dd1cff10b6dbd148814979132111da76e29551 Mon Sep 17 00:00:00 2001
From: 65160381 <65160381@go.buu.ac.th>
Date: Mon, 24 Mar 2025 15:36:07 +0000
Subject: [PATCH] Update file loginController.js

---
 controllers/loginController.js | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/controllers/loginController.js b/controllers/loginController.js
index 0ef09e3..a7de748 100644
--- a/controllers/loginController.js
+++ b/controllers/loginController.js
@@ -18,7 +18,7 @@ module.exports = {
             const user = rows[0];
             const match = await bcrypt.compare(rpassword, user.password);
             if (match) {
-                req.session.userId = user.id
+                req.session.userId = user.user_id; // ใช้ user_id แทน id
                 res.redirect('/');
             } else {
                 req.flash('message', 'Password incorrect');
-- 
GitLab