[Auth Providers] how to add scope for google

For V4, I did this in src/index.js


  async bootstrap({ strapi }) {
    const pluginStore = strapi.store({
      environment: '',
      type: 'plugin',
      name: 'users-permissions',
    });
    // Ensure profile scope for Google Auth
    const grantConfig = await pluginStore.get({ key: 'grant' })
    if(grantConfig){
      if(grantConfig.google && grantConfig.google.scope){
        grantConfig.google.scope = ['openid', 'email', 'profile']
        await pluginStore.set({ key: 'grant', value: grantConfig });
      }
    }
  },
3 Likes