React-google-login: Login does not persist (again)

Created on 10 Jul 2018  路  7Comments  路  Source: anthonyjgrove/react-google-login

It looks like issue #69 is back (or maybe it was never fully fixed?). I'm initializing the component as follows and finding that every page load, even a soft refresh, requires users to complete the OAuth consent prompt.

Any thoughts or hints? I'm using v3.2.0.

<GoogleLogin
            clientId={MY_CLIENT_ID}
            buttonText="Login with Google"
            responseType={"id_token"}
            accessType={"offline"}
            onSuccess={this.loginSuccess}
            onFailure={this.loginFailure}
            prompt={"consent"}
/>

Most helpful comment

I added the isSignedIn={true} prop and it called my onsuccess handler on refresh.

All 7 comments

I added the isSignedIn={true} prop and it called my onsuccess handler on refresh.

Unfortunately, I found out that if the user is signed out however, there is no way to detect that 馃槩

@protoEvangelion I just tested your isSignedIn={true} right now and it did worked for me.
Thanks!

Closing Due to Inactivity

@protoEvangelion Any workaround? I'm trying to have a "load" spinners while the component decides if the user is logged in, or not. I can see the success being called if he/she is logged in, but nothing happens if not (e.g. incognito tab).

I'm not sure. I'd create a new issue if I was you so the maintainers can respond :) And its been 2 years since this issue opened so things may have changed.

@protoEvangelion Any workaround? I'm trying to have a "load" spinners while the component decides if the user is logged in, or not. I can see the success being called if he/she is logged in, but nothing happens if not (e.g. incognito tab).

The login hook provides a loaded const that you can use to hide your spinner.

Was this page helpful?
0 / 5 - 0 ratings