您好,我使用护照登录,我刚刚创建了一条简单的登录路径
app.get(
"/auth/google/callback",
passport.authenticate('google', (req, res) => {
res.redirect('/info');
})
);
这是我的代理人
"proxy": {
"/auth/google": {
"target": "http://localhost:5000"
},
"/api/*": {
"target": "http://localhost:5000"
}
},
但是在尝试调用GOOGLE CALL后遇到错误
代理错误:无法代理请求/ auth / google / callback?code = 4 / YABLvS02ekEDkUSrKF-9fW0fhUdCOxxjPy_BcqEUmApkpGBypD9AQlZmG4LwuPtioFOCHZ0dmy_PPReAq9e5nio&scope = {{}}到():{} 3}
答案 0 :(得分:0)
已解决。
缺少组件Header.js
// gets called with the state object
// returns an object which sets the prop
// for the component (Header)
function mapStateToProps(state) {
return { auth: state.auth };
}
export default connect(mapStateToProps)(Header);