1
votes

Hello Im using passport to log in , i just created a simple route to log in

      app.get(
        "/auth/google/callback",
        passport.authenticate('google', (req, res) => {
        res.redirect('/info');
        })
      );

And Here's my proxy

    "proxy": {
        "/auth/google": {
        "target": "http://localhost:5000"
        },
        "/api/*": {
        "target": "http://localhost:5000"
        }
    },

But im getting an error trying to respond after the GOOGLE CALL

Proxy error: Could not proxy request /auth/google/callback?code=4/YABLvS02ekEDkUSrKF-9fW0fhUdCOxxjPy_BcqEUmApkpGBypD9AQlZmG4LwuPtioFOCHZ0dmy_PPReAq9e5nio&scope=https://www.googleapis.com/auth/userinfo.email+https://www.googleapis.com/auth/userinfo.profile from localhost:3000 to http://localhost:5000 (ECONNRESET).

1

1 Answers

0
votes

Solved.

Component Header.js was missing

            // 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);