react-gmail-client icon indicating copy to clipboard operation
react-gmail-client copied to clipboard

Cannot read property 'w3' of undefined

Open btilds opened this issue 5 years ago • 1 comments

Something about authentication and the googleUser variable in App.jsx

Screen Shot 2021-01-16 at 6 27 09 PM

I think something from this function that googleUser isn't set to anything ... not sure.

btilds avatar Jan 17 '21 01:01 btilds

The code is accessing properties on the user instead of using the API to get them. Google seem to randomize these to prevent people accessing them directly. for example instead of getting the user with googleAuthInstance.currentUser.Ab it should get it via googleAuthInstance.currentUser.get() and instead of getting the user info with const userInfo = this.props.googleUser.w3; it should be const userInfo = this.props.googleUser.getBasicProfile(); etc

Google doco is here https://developers.google.com/identity/sign-in/web/reference#googleauthcurrentuserget

josephcooney avatar May 30 '21 22:05 josephcooney