google/google-api-javascript-client

opt_out_or_no_session error

peter100u opened this issue · 1 comments

Summary
If the browser on the Android device has never logged in to the Google account, the one-click login function on our website has a opt_out_or_no_session error, so that we cannot use the one-click login function of the Google account, if you want to continue to use this function, you need to create a new browser tab and log in to other websites. Log in to the Google account on people's website, and then return to our website to use the one-click login function normally, the above problems are Android devices, iOS devices are no problem.

Browser(s)/Version(s)
It has nothing to do with the Android browser, we tested 5 Android devices and all with the same results

Expected Behavior
Open our website (https://www.ohlamusic.com/#/home), click Google one-click login below, please check the browser console to report the error message, there is my video below

** code **

componentDidMount() {
const handleCredentialResponse = (response) => {
console.log("google login ====", response);
this.thirdLoginReq(2, response.credential);
};
window.google.accounts.id.initialize({
client_id: PD.google_client_id,
auto_select: true,
ux_mode: "redirect",
cancel_on_tap_outside: false,
itp_support: true,
callback: handleCredentialResponse
});
}
// google 登录
googleLoginReq() {
window.google.accounts.id.prompt((notification) => {
if(notification.j == "suppressed_by_user") {
Cookies.remove('g_state');

651_1688483556.mp4
    this.googleLoginReq();
  }
});
window.google.accounts.id.cancel();

}