setup login page
this.auth2 = window.gapi.auth2
.init({
client_id: process.env.GOOGLE_ID,
ux_mode: 'redirect',
redirect_uri: process.env.GOOGLE_LOGIN_REDIRECT, // https://domain/callback
scope: 'profile email',
prompt: 'select_account',
})
.then(() => {
let googleAuth = window.gapi.auth2.getAuthInstance();
googleAuth.signIn()
});
in callback page
window.gapi.auth2.getAuthInstance().currentUser.get().getAuthResponse()
is empty only in IOS 14.2 but another version is work and android is work also.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…