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.11k stars 139 forks source link

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

Open kueiRad opened 4 months ago

kueiRad commented 4 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 3 months ago

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

barankauf commented 1 month ago

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

kueiRad commented 1 month 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

Micode360 commented 1 week ago

Still no fix on this? I need this now. This is so frustrating.

barankauf commented 1 week ago

@kueiRad how did you handle the event propagation if the user clicks the image?

kueiRad commented 1 week ago

@kueiRad how did you handle the event propagation if the user clicks the image?

I wrote a javascript onclick on the image to create a click event for the GoogleLogin component

barankauf commented 1 week ago

@kueiRad how did you handle the event propagation if the user clicks the image?

I wrote a javascript onclick on the image to create a click event for the GoogleLogin component

Which method did you call? Is there a google login method?