Google Oauth 2.0 redirect Cloudfronrt and EC2

У меня есть nodejs web app running on ec2. And I am using cloudfront с ec2 to access the web.

Я пытаюсь реализовать google oauth login using passport-google-oauth20 everything is working fine but my redirect url is not coming back to cloudfront domain it goes to the ec2 public url http://************.eu-west-1.compute.amazonaws.com/auth/google/redirect

how can I redirect it to cloudfront url or domain? пожалуйста помоги

Passport Strategy

passport.use(
new GoogleStrategy({
    callbackURL : '/auth/google/redirect',
    clientID : config.google.clientId,
    clientSecret : config.google.clientSecret
},(accessToken,refreshToken,profile,done) => {

    let details = {
        email : profile.emails[0].value,
        name : profile.displayName,
        firstname : profile.name.givenName,
        lastname : profile.name.familyName,
        username : profile.id,
        provider : profile.provider,
        token : accessToken,
        profilepic: profile.photos[0].value.split("?")[0],

    }

   done(null,details);
}));

Маршрутизатор:

router.get('/google/redirect',passport.authenticate('google',{ session: false }),AuthController.googleLogin);

0 ответов

Другие вопросы по тегам