Gitlab@Informatics

Skip to content
Snippets Groups Projects
Commit 90dd1cff authored by 65160381's avatar 65160381
Browse files

Update file loginController.js

parent 4b4d473d
No related branches found
No related tags found
No related merge requests found
Pipeline #558 passed with warnings
...@@ -18,7 +18,7 @@ module.exports = { ...@@ -18,7 +18,7 @@ module.exports = {
const user = rows[0]; const user = rows[0];
const match = await bcrypt.compare(rpassword, user.password); const match = await bcrypt.compare(rpassword, user.password);
if (match) { if (match) {
req.session.userId = user.id req.session.userId = user.user_id; // ใช้ user_id แทน id
res.redirect('/'); res.redirect('/');
} else { } else {
req.flash('message', 'Password incorrect'); req.flash('message', 'Password incorrect');
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment