#Sign in with Google not working in Production

4 messages · Page 1 of 1 (latest)

indigo berry
#

Hi all. I use passport-google-oauth20 with Nodejs backend and mysql database on Nuxt3. Sign in with Google works fine in localhost. But its not working in production. I get this error (Screenshot attached.)

I understand that wrong runtimeConfig may break Public or private may break . But I am not finding where it is wrong. Also the error is generic. Please help. I'm happy to provide more details.

worldly musk
#

could be that your env variables are being lost during the build process since they are not prefixed w/ NUXT

#

i would try and log these to see if they are being properly set:

wraith mica
#

@indigo berry try this:

const config = useRuntimeConfig()

passport.user(new GoogleStrategy({
  clientID: config.googleClientId,
  clientSecret: config.googleClientSecret,
  callbackURL: '/api/auth/google/callback',
  scope: ['profile', 'email']
},