MomenSherif / react-oauth

Google OAuth2 using the new Google Identity Services SDK for React 🚀
https://www.npmjs.com/package/@react-oauth/google
MIT License
1.12k stars 139 forks source link

Migration issue from react-google-login #257

Open johndunlap opened 1 year ago

johndunlap commented 1 year ago

I'm trying to migrate from away react-google-login to this library and I'm running into some snags. I'm not getting an id_token property in the response and I need this to send to my server so that it can verify my identity. All I'm getting is access_token but I'm unable to verify this on my server because it only contains a single period and not two(apparently it's not a JWT). Any tips about what I'm doing wrong would be appreciated.

MomenSherif commented 1 year ago

If you want direct id_token you can use GoogleButton Or if you are going to use the custom hook you will get an access_token which can be replaced by backend for other tokens

https://github.com/MomenSherif/react-oauth/issues/12 You will find backend sample here