Search code examples
javascriptoauth-2.0nuxt.js

NUXTJS auth redirects to /login with query string if I'm login with Google strategy


After getting authenticated from google it redirects me to /login?state=....

  • I was implementing this from the documentation

My question is why I m not logged in? There is no user data in this.$auth And loggedIn property is also false Is there any step todo further which I am missing out?

nuxt.config.js

auth: {
    strategies: {
      google: {
        clientId: process.env.GOOGLE_CLIENT_ID,
        responseType: 'code',
        codeChallengeMethod: '',
      },
   },
}

login.vue

    this.$auth.loginWith('google');


Solution

  • I got the fix by replacing

    responseType: 'token id_token',