-
Notifications
You must be signed in to change notification settings - Fork 641
Open
Description
Login without remember-me option as It will redirect to /home but even if session is assign then also while re-traversing index page It wont redirect to /home so to Fix this
Inside routes.js replace this function with this function which is below
app.get('/', function(req, res){
// This one is for If session is assign so redirect it
if(req.session.user)
{
res.redirect('/home');
}
// check if the user has an auto login key saved in a cookie //
else if (req.cookies.login == undefined){
res.render('login', { title: 'Hello - Please Login To Your Account { For Exp} ' });
}
else{
// attempt automatic login //
AM.validateLoginKey(req.cookies.login, req.ip, function(e, o){
if (o){
AM.autoLogin(o.user, o.pass, function(o){
req.session.user = o;
res.redirect('/home');
});
} else{
res.render('login', { title: 'Hello - Please Login To Your Account' });
}
});
}
});
Metadata
Metadata
Assignees
Labels
No labels