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.13k stars 141 forks source link

prompt: 'none' not working for useGoogleLogin #347

Open ChenCodes opened 6 months ago

ChenCodes commented 6 months ago

Hi there,

Thanks for starting this library. I'm trying to find a way to use useGoogleLogin where once the user has authenticated once, they do not need to do it again when useGoogleLogin is called. I see the prop in the documentation that says I should be able to use prompt: 'none' but when I passed it into my useGoogleLogin call it still seems to require selecting a user account each time that I invoke the login method.

Has anyone been able to get useGoogleLogin to work in conjunction with the prompt: 'none' setting?

Any help would be greatly appreciated!

const login = useGoogleLogin({
    onSuccess: (codeResponse) => {
      setAuthCode(codeResponse.code)
    },
    flow: 'auth-code',
    scope: googleLoginScopes,
    prompt: 'none',
  })
RubhiniP commented 1 week ago

Facing the same issue here