Используя очень простые простые примеры, предоставленные Google (Firebase Google Auth), я не смог выйти из Google.
Каждый раз, когда я вызываю этот метод с помощью кнопки, он позволяет мне войти инаправляет меня к местному хозяину.
function logGoogle() {
firebase.auth().signInWithPopup(provider).then(function(result) {
// This gives you a Google Access Token. You can use it to access the Google API.
var token = result.credential.accessToken;
// The signed-in user info.
var user = result.user;
location.href = 'http://localhost:8080';
// ...
}).catch(function(error) {
// Handle Errors here.
var errorCode = error.code;
var errorMessage = error.message;
// The email of the user's account used.
var email = error.email;
// The firebase.auth.AuthCredential type that was used.
var credential = error.credential;
// ...
console.log(errorCode);
console.log(errorMessage);
console.log(email);
console.log(credential);
});
}
однако, когда я возвращаюсь в главное меню, которое состоит из кнопки выхода из системы.Он завершает сеанс, не удаляет сеанс.Когда я снова вхожу в систему, мне не нужно вводить кредиты Google.Помните, что я вошел в Google Chrome, используя учетную запись Gmail.
function logOutGoogle() {
firebase.auth().signOut().then(function () {
console.log("you logged off");
location.href = 'http://localhost/GoogleVue3/';
}).catch(function (error) {
alert(error);
});
}
Я пробовал в режиме инкогнито.вошел в Google Credits, зашел в приложение и решил выйти.Нажмите, чтобы войти в Google, он автоматически приведет меня к приложению.
какие-либо советы?