I am trying to add logout feature using passport local strategy.
I followed the solutions discussed here, here and here
I added a
a(href='/logout') logout
link in my index.jade file.
In my app.js I added the following:
app.get('/logout', function (req, res) {
console.log("trying to logout....")
req.session.destroy()
req.logout()
res.redirect('/signin');
});
But when I click the logout href It goes to my 404 page. In the browser url I see that it is attempting to go to:
localhost:3030/logout
I event added an empty logout.jade
view but it makes no difference.
What am i doing wrong?
Also - I do not see the console.log("trying to logout...")
message in my terminal... so it looks like it never reached the correct method.