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.07k stars 136 forks source link

GoogleLogin and useGoogleLogin (implicit & auth-code) do NOT return matching responses #355

Open kueiRad opened 2 months ago

kueiRad commented 2 months ago

GoogleLogin returns keys including a credentials key:value pair. For our login process, we can use this credentials value with jwt.decode to get an Object containing email, first/last name, avatar image.

I'm trying to create a custom button instead of using GoogleLogin, because GoogleLogin seems to be bugged on Mobile developer mode where the right side of the iframe is overflowing and clipping. From the project readme, I have to use useGoogleLogin.

useGoogleLogin with auth-code flow returns "code", which is not jwt, and nowhere does it say what I'm supposed to do with the value of "code". useGoogleLogin with implicit flow returns "access_token", which is not jwt either.

Your code example just says to console log this code or access_token value, which is not informative. How are you supposed to use useGoogleLogin?

deepakbytebard commented 1 month ago

Any updates on this? as I am facing the similar issue.

barankauf commented 2 days ago

I am also interested in how I can use useGoogleLogin to get the same response as the default one.

kueiRad commented 2 days ago

no updates yet, in the mean time I did some hacky css things (overlay an image of what it looks like correctly) to keep using the GoogleLogin component, hopefully a dev responds