I have next code
render={(renderProps: any) => (
<a
onClick={renderProps.onClick()}
className="link-google auth-link" title="Google"
>
<i className="fi flaticon-google-plus-logo" />
</a>
)}
and have error only in IE11 signIn null or undefined
I have same issue google-login.js:1 - Uncaught TypeError: Cannot read property 'signIn' of null on Google Chrome 69
<GoogleLogin
clientId={CONFIG.googleId}
buttonText="Login"
onSuccess={this.handleGoogleResponse}
onFailure={this.handleGoogleResponse}
/>
@RomaMoisiuk add please code for method handleGoogleResponse
@pogran
handleGoogleResponse = (response) => {
const tokenBlob = new Blob([JSON.stringify({access_token: response.accessToken}, null, 2)], {type: 'application/json'});
const options = {
method: 'POST',
body: tokenBlob,
mode: 'cors',
cache: 'default'
};
fetch(`${CONFIG.api_url}/auth/google`, options).then((r) => {
const token = r.headers.get('x-auth-token');
r.json().then((user) => {
if (token) {
this.setState({isAuthenticated: true, user, token})
window.location.href = `${CONFIG.ui_home}`;
}
});
})
};
Closing Due to Inactivity
Most helpful comment
I have same issue
google-login.js:1 - Uncaught TypeError: Cannot read property 'signIn' of nullon Google Chrome 69<GoogleLogin clientId={CONFIG.googleId} buttonText="Login" onSuccess={this.handleGoogleResponse} onFailure={this.handleGoogleResponse} />