nuxt-community / auth-module

Zero-boilerplate authentication support for Nuxt 2
https://auth.nuxtjs.org
MIT License
1.93k stars 925 forks source link

Is it possible to configure what user info you get when logging in with Google? #1756

Open Aaron-Hoffman opened 2 years ago

Aaron-Hoffman commented 2 years ago

I'm trying to set up Nuxt Auth with Google and it seems to be working pretty well so far. I have two questions.

  1. Do I actually need to create my own backend endpoints to hit? It seems to be doing what I want already, but the docs mention custom endpoints so I want to make sure I'm not totally missing a step.

  2. Is it possible to configure what information is assigned to $auth.user ? Right now I'm getting certain fields like email and family_name etc. but I'd really like to get some other information about the accounts back. I've added an appropriate scope to my scopes property for the google strategy, which seems to be working when I see the consent screen. It doesn't seem to automatically hit that endpoint and add that information onto the user. Is there a way to set that up, or would I have to do that manually.

Thanks in advance for any advice.

Aaron-Hoffman commented 2 years ago

To clarify a bit more: It seems the module is configured to get user info from https://www.googleapis.com/oauth2/v3/userinfo. I would like to also hit another google endpoint to add some additional data to the user.