Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/javascript/461.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript Firebase google auth未完全注销_Javascript_Firebase_Firebase Authentication - Fatal编程技术网

Javascript Firebase google auth未完全注销

Javascript Firebase google auth未完全注销,javascript,firebase,firebase-authentication,Javascript,Firebase,Firebase Authentication,使用Google(Firebase Google Auth)提供的非常简单的示例,我无法从Google注销 每次使用按钮调用此方法时,它都允许我登录并将我导航到本地主机。 函数logGoogle(){ firebase.auth().signInWithPopup(提供程序)。然后(函数(结果){ //这将为您提供一个Google访问令牌。您可以使用它访问Google API。 var token=result.credential.accessToken; //已登录的用户信息。 var us

使用Google(Firebase Google Auth)提供的非常简单的示例,我无法从Google注销

每次使用按钮调用此方法时,它都允许我登录并将我导航到本地主机。
函数logGoogle(){
firebase.auth().signInWithPopup(提供程序)。然后(函数(结果){
//这将为您提供一个Google访问令牌。您可以使用它访问Google API。
var token=result.credential.accessToken;
//已登录的用户信息。
var user=result.user;
location.href=http://localhost:8080';
// ...
}).catch(函数(错误){
//在这里处理错误。
var errorCode=error.code;
var errorMessage=error.message;
//使用的用户帐户的电子邮件。
var email=error.email;
//使用的firebase.auth.AuthCredential类型。
var-credential=error.credential;
// ...
控制台日志(错误代码);
控制台日志(错误消息);
控制台日志(电子邮件);
控制台日志(凭证);
});

}
基本上,firebase注销功能会注销应用程序本身,但不会在浏览器上注销google

要完全注销,您需要先注销应用程序,然后如果成功,在浏览器中注销Google。 这样,用户就可以在注销后不再登录

功能签核(){
firebase.auth().signOut().then(函数(){
window.alert(“您已成功注销”)
window.location=”https://mail.google.com/mail/u/0/?logout&hl=en";
//document.location.href=”https://www.google.com/accounts/Logout?continue=https://appengine.google.com/_ah/logout?continue=http://localhost/GoogleVue4";
}).catch(函数(错误){
console.log(错误);
})
}
您可能并不真的想在浏览器中注销谷歌(因为它会让您注销Gmail以及您正在使用谷歌应用程序的任何其他选项卡/窗口)。当你再次点击Firebase auth时,它会直接跳入应用程序(绕过谷歌登录,因为它从未真正从谷歌注销)。与其立即登录,也许您希望看到Google帐户选择器。如果是这样,我给出了一个相关的so问题

请注意,您描述的问题只会发生在您只登录了一个Google/Gmail帐户的情况下,例如,与您在incog模式下一样。如果您登录到>1,您将始终获得帐户选择器,以便Firebase可以告诉您的应用程序您选择了哪个用户