In Firebase, I am using AuthUI for Sign In. I tried FirebaseAuth.getInstance.signout()
to remove the current user credentials, but I think maybe for Google SmartLock credentials, it's not signing out. Help me out.
My Code:
mAuthStateListener = new FirebaseAuth.AuthStateListener() {
@Override
public void onAuthStateChanged(@NonNull FirebaseAuth firebaseAuth) {
FirebaseUser user = firebaseAuth.getCurrentUser();
if (user != null){
if (user.getEmail().equals("[email protected]")){
//Codes to implement
} else {
FirebaseAuth.getInstance().signOut();
}
} else {
startActivityForResult(
AuthUI.getInstance()
.createSignInIntentBuilder()
.setIsSmartLockEnabled(false)
.setProviders(Arrays.asList(
new AuthUI.IdpConfig.Builder(AuthUI.GOOGLE_PROVIDER).build()))
.build(), RC_SIGN_IN
);
}
}
};
}
For me the fix was;
AuthUI.getInstance().setIsSmartLockEnabled(false)...
When logging in, and then;
AuthUI.signOut(context)
When Signing out
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With