Skip to content

Commit cff0c48

Browse files
committed
Minor changes due to guest login
1 parent a5b067d commit cff0c48

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

controllers/user_controller.js

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,8 +59,14 @@ module.exports.signIn = async function (req, res) {
5959
res.cookie("jwt_token", token); // , { maxAge: 1000, httpOnly: true } = for set the cookie expire time
6060
// res.status(200).send(`<script> window.location.href='/user_dashboard'; </script>`);
6161
// res.redirect('/user_dashboard');
62-
res.status(200).json({ redirect: '/user_dashboard' });
63-
62+
// res.status(200).json({ redirect: '/user_dashboard' });
63+
64+
if (user.email == "guest@gmail.com" && user.password == "guest123") {
65+
res.status(200).json({ redirect: '/user_dashboard' });
66+
}
67+
else {
68+
res.status(200).send(`<script> window.location.href='/user_dashboard'; </script>`);
69+
}
6470
}
6571
}).catch((err) => {
6672
console.log(err);

0 commit comments

Comments
 (0)