Skip to content Skip to sidebar Skip to footer

Logout From Google After Login Out From Firebase

I'm using Firebase authentication with google accounts. Login process works fine, but I have a problem with logout. I successfuly log out of firebase, but not from google. That mea

Solution 1:

Normally this is expected behavior. Sign out from firebase is unrelated to sign out from google. User would need to explicitly sign out from google. However, if you know your application will be used on a share device you can do the following:

// Sign out from firebase.
firebase.auth().signOut().then(function() {
  // Redirect to google sign out.window.location.assign('https://accounts.google.com/logout');
}).catch(function(error) {
  // Error occurred.
});

Solution 2:

mGoogleSignInClient.signOut().addOnCompleteListener(ClassName.this, new OnCompleteListener() { @Override public void onComplete(@NonNull Task task) { Toast.makeText(ClassName.this, "logged out", Toast.LENGTH_SHORT).show(); } });

Post a Comment for "Logout From Google After Login Out From Firebase"