我正在尝试实现Facebook通行证,我在server.js中的代码如下所示。这是当用户通过Facebook登录时使用的路由。
router.get('/auth/facebook',
passport.authenticate('facebook',{ scope : 'email' }),
function(req, res){
});
成功登录后,它会重定向到success.html,其中包含注销按钮。
router.get('/auth/facebook/callback',
passport.authenticate('facebook', {
successRedirect : '/success',
failureRedirect: '/'
}),
function(req, res) {
res.render('success.html');
});
退出路由是:
router.get('/logout', function(req, res){
req.logout();
res.redirect('/');
});
如果我点击注销按钮,我仍将被重定向到主页。
router.get('/', function(req, res){
res.render('auth.html');
});
auth.html
<html>
<head>
<title>Node.js OAuth</title>
</head>
<body>
<a href="/auth/facebook">Sign in with Facebook</a>
</body>
</html>
but after if i click the Sign in with Facebook link i will directly take to success.html page and again i was never able to see the Facebook login page where we provide the credentials of the Facebook account
*我尝试从数据库中删除详细信息,但它仍然指向success.html *我尝试删除cookie并使用新的浏览器实例 *没有成功,请指出可能的错误