0
나는 내 웹 사이트에 Google 및 Facebook 로그인 정보를 통합합니다. 그리고 사람이 FB 또는 Google로 로그인 할 수있는 조건을 설정하십시오. 이제 문제는 내 Gmail 계정이 동일한 브라우저에서 열려 있으면 내 Google 로그인 기능이 자동으로 작동한다는 것입니다.모든 페이지에서 전화 할 수있는 Google 로그인 기능 사용하지 않음
function loggedOut(href){
gapi.load('auth2', function() {
gapi.auth2.init();
});
setTimeout(function(){
var auth2 = gapi.auth2.getAuthInstance();
auth2.signOut().then(function() {
//console.log('User signed out.');
document.location = href;
});
}, 2000);
}
function onSignIn(googleUser) {
var profile = googleUser.getBasicProfile();
var fullName = profile.getName(),
imageUrl = profile.getImageUrl(),
email = profile.getEmail(),
provider = 'Google';
$.ajax({
url: 'includes/google-login.php',
type: 'POST',
data: { provider: provider, fullName :fullName, imageUrl : imageUrl, email: email },
success: function(data){
console.log(data);
if(data == 1){
location.reload();
} else if(data.trim().match("^Entered")){
alert(data);
loggedOut('This Page URL');
}
}
});
};
$('#log-out').on('click', function(e){
e.preventDefault();
var href = $(this).attr('href');
loggedOut(href);
});