Google Oauth giving code redeemed error

前端 未结 4 436
甜味超标
甜味超标 2021-01-13 07:40

Hi i am working on a project where a user logs in via google account.(localhost) I have implemented the google signup. As soon as I log in from my account I am getting the b

4条回答
  •  日久生厌
    2021-01-13 08:22

    The problem is not in your "snippet", look at the routes. It should be absolute path on redirect for google.

    router.get('/auth/google/callback',
    passport.authenticate('google', { failureRedirect: '#/signIn' }),
    function(req, res) {
    // absolute path
        res.redirect('http://localhost:8888/#/home');
    });
    

    It's known issue, follow this link to other workarounds https://github.com/jaredhanson/passport-google-oauth/issues/82

提交回复
热议问题