Skip to content
This repository was archived by the owner on Apr 4, 2023. It is now read-only.

Commit 1635112

Browse files
Merge pull request #303 from RaphaelJenni/master
On login failed, show google account modal again
2 parents ba2f3fb + 032a5fc commit 1635112

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

firebase.android.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -800,6 +800,10 @@ firebase.login = function (arg) {
800800
}
801801
if (!task.isSuccessful()) {
802802
console.log("Logging in the user failed. " + (task.getException() && task.getException().getReason ? task.getException().getReason() : task.getException()));
803+
// also disconnect from Google otherwise ppl can't connect with a different account
804+
if (firebase._mGoogleApiClient) {
805+
com.google.android.gms.auth.api.Auth.GoogleSignInApi.revokeAccess(firebase._mGoogleApiClient);
806+
}
803807
reject("Logging in the user failed. " + (task.getException() && task.getException().getReason ? task.getException().getReason() : task.getException()));
804808
} else {
805809
var user = task.getResult().getUser();

firebase.ios.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -901,6 +901,10 @@ firebase.login = function (arg) {
901901
try {
902902
var onCompletion = function(user, error) {
903903
if (error) {
904+
// also disconnect from Google otherwise ppl can't connect with a different account
905+
if (typeof(GIDSignIn) !== "undefined") {
906+
GIDSignIn.sharedInstance().disconnect();
907+
}
904908
reject(error.localizedDescription);
905909
} else {
906910
resolve(toLoginResult(user));

0 commit comments

Comments
 (0)