Get access_token when use uxMode="redirect" on react-google-login

Viewed 686

I use 'react-google-login'. I need to send access_token to the back-end, and when I use uxMode="popup", onSuccess function is called, so I can get access_token from the response.

But I want to use uxMode="redirect". Here is my code:

<GoogleLogin
              clientId="..."
              buttonText="go to sign in"
              onSuccess={::this.responseGoogle}
              onFailure={::this.errorGoogle}
              onRequest={::this.onRequest}
              uxMode='redirect'
              redirectUri={window.location.origin + '/auth/google/callback'}
            />

It doesn't call onSuccess function and redirects to the '/auth/google/callback'. I can't get this parameter from location.hash(but it has id_token). From what can I get access_token and is it possible at all ?

0 Answers
Related