1

I'm building a frontend app based on NuxtJS with Strapi as the backend. I've already configured the google provider on Strapi. However, once it's time to connect it with the frontend I run into a problem. Basically, after logging in, it redirects me to the frontend URL with the token and not directly to the homepage.

Below is my nuxt-config code:

auth: {
  strategies:{
    google: {
      clientId: 'google_client_id',
      codeChallengeMethod:'',
      endpoints: {
        authorization: 'https://strapi.backend.com/connect/google',
        token: 'https://strapi.backend.com/token',
        userInfo: 'https://strapi.backend.com/users/me'
      },
      token: {
        property: 'id_token',
        type: 'jwt',
        maxAge: 1800
      },
      responseType: 'token',
      grantType: 'authorization_code',
    }
  }
}

Login.vue code

export default {
  methods: {
    async google(){
    await this.$auth.loginWith('google')
  }
}

Let me know please if I'm missing something.

kissu
  • 40,416
  • 14
  • 65
  • 133

1 Answers1

0

Did you tried using the redirect key?

auth: {
  redirect: {
    home: '/',
  },
  ...
}
kissu
  • 40,416
  • 14
  • 65
  • 133