I am calling login, after successfull login, I would like to show dashboard screen.
But, dashboard page is not displaying after successful login. page is not refreshing, login page remains. No change.
Please help me to redirect to dashboard URL:
Angular JS Code
function loginctrl($scope, $http) {
$scope.login = function() {
emp_url = '/login';
emp_msg = "SUCCESSFULLY SIGN Up";
$http.post(emp_url, $scope.formData).success(function(data) {
});
};
}
Node.js Code
app.get('/dashboard', isLoggedIn, function(req, res){
res.sendfile('./public/template-home.html', {user : req.user});
});
app.post('/login', passport.authenticate('local-login', {
successRedirect : '/dashboard', // redirect to the secure dashboard section
failureRedirect : '/login', // redirect back to the signup page if there is an error
failureFlash : true // allow flash messages
}));