I am working on adding one tap login to my project using google JS api, code for the same
google.accounts.id.initialize({
client_id: CLIENT_ID,
cancel_on_tap_outside: false,
callback: LoginSuccess,
prompt_parent_id: "root",
itp_support: true,
});
This is working fine firefox, safari in both normal and incognito mode, but in chrome its working fine in normal but not working in incognito mode (Allowed all the cookies in incognito), it returning response as opt_out_or_no_session
.
i tried with setting the g_state
cookie, but it doesn’t not work
google.accounts.id.prompt(function(oneTapPromptResponse) {
if (oneTapPromptResponse.isNotDisplayed()) {
document.cookie = "g_state=;path=/;expires=Thu, 01 Jan 1970 00:00:01 GMT";
console.info("Google Login Not Displayed");
} else if (oneTapPromptResponse.isSkippedMoment()) {
console.info("Google Login skiiped");
} else if (oneTapPromptResponse.isDismissedMoment()) {
console.info("Google Login dismissed");
} else if (oneTapPromptResponse.isDisplayed()) {
console.info("Google Login displayed")
}
});
Attached the image for Firefox private browsing mode response
Can anyone help me to resolve this.