So my project has 3 dashboards for client, admin and employee. All the three have different functionalities and options. (a little bit change)
All 3 login with same login page that is : localhost:3000/login
and all the 3 dashboards are dependent on each other. Suppose client add some tasks in his dashboard then admin approves it via his respective dashboard and then the employee updates the task status via his dashboard that is also being updated on the other 2 dashboards.
So to check all the functionalities parallely, I logged in all on 3 separate localhost:3000/login
tabs in same Google Chrome for testing purpose instead of logging in again and again serial wise and checking if the data is being updated.
But by doing with separate dashboards, the data some-while gets mismatched and not updated. So I am thinking that after deploying the code will that be a problem when all the 3 users will login simultaneously and start making changes? Will it work fine after deployment or is it just on localhost.
Here is the login code in nodejs I am using for all users:
router.route('/login')
.get(function(req, res, next) {
res.render('login', { title: 'Login your account'});
})
.post(passport.authenticate('local', {
failureRedirect: '/login'
}), function (req, res) {
if(req.user.tag == 'Emp')
res.redirect('/profileEmp');
else if(req.user.tag == 'Admin')
res.redirect('/profileAdmin');
else {
res.redirect('/profile');
}
// console.log(req.user.email);
});
P.S. All dashboards work fine when I make changes with one dashboard login only and then again I logout and login to another dashboard say Employee one; it works fine.