이 문제도 발생했습니다. 당신은 즉시 Gmail 계정에서 로그 아웃 할 필요가 당신의 Gmail 인증에서 이메일 ID를 얻을 :
<script src="https://apis.google.com/js/platform.js?onload=renderButton" async defer></script>
<script>
function onSuccessG(googleUser) {
var profile = googleUser.getBasicProfile();
console.log('ID: ' + profile.getId()); // Do not send to your backend! Use an ID token instead.
console.log('Name: ' + profile.getName());
console.log('Image URL: ' + profile.getImageUrl());
console.log('Email: ' + profile.getEmail());
//now here write a code of login//
//
//now here write a code of login//
signOut();//call sign out function which will sign out user from their gmail accont
}
function onFailureG(error) {
console.log(error);
}
function renderButton() {
gapi.signin2.render('my-signin2', {
'scope': 'https://www.googleapis.com/auth/plus.login',
'width': 323,
'height': 35,
'longtitle': true,
'theme': 'dark',
'onsuccess': onSuccessG,
'onfailure': onFailureG
});
}
function signOut() {
var auth2 = gapi.auth2.getAuthInstance();
auth2.signOut().then(function() {
console.log('User signed out.');
});
}
의 중복 가능성 [방지 자동 로그인 할 때 사용하는 Google+ 로그인] (HTTP ://stackoverflow.com/questions/15484533/preventing-automatic-sign-in-when-using-google-sign-in) –