Passportjs重定向在URL中添加标签
我在我的mean stack网站上有一个登录页面。该网站使用Passportjs重定向在URL中添加标签,url,angular-ui-router,passport.js,hashtag,html5mode,Url,Angular Ui Router,Passport.js,Hashtag,Html5mode,我在我的mean stack网站上有一个登录页面。该网站使用HTML5模式,并具有。登录使用Passport.js,例如: router.get('/' + process.env.versionNumber + '/auth/google', passport.authenticate('google', { scope: ['https://www.googleapis.com/auth/userinfo.profile', 'https://www.googleapis.c
HTML5模式
,并具有
。登录使用Passport.js
,例如:
router.get('/' + process.env.versionNumber + '/auth/google', passport.authenticate('google', { scope: ['https://www.googleapis.com/auth/userinfo.profile',
'https://www.googleapis.com/auth/userinfo.email'] }));
router.get('/' + process.env.versionNumber + '/auth/google/callback', passport.authenticate('google', {
successRedirect: '/' + process.env.versionNumber + '/dashboard',
failureRedirect : '/' + process.env.versionNumber + '/login',
failureFlash : true
}))
对于Twitter、GitHub和Linkedin,它们都会重定向到https://localhost:3000/1/dashboard
。但是,Google将重定向到https://localhost:3000/1/dashboard#
和Facebook重定向到https://localhost:3000/1/dashboard#_=_
有人知道发生了什么吗?我不认为这是angular的专利。我使用它没有角度,我有同样的问题。回调url中的successRedirect值是我指向dashboard.html的位置。只有在我使用passport-google-oauth20策略实现了passport之后,才出现了#