Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/jsf-2/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Passportjs重定向在URL中添加标签_Url_Angular Ui Router_Passport.js_Hashtag_Html5mode - Fatal编程技术网

Passportjs重定向在URL中添加标签

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

我在我的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.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之后,才出现了#