Skip to content
This repository was archived by the owner on Mar 17, 2025. It is now read-only.

Commit 2174847

Browse files
author
jacobawenger
committed
Fixed bug from calling $logout multiple times
1 parent 9eeaa5c commit 2174847

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

src/firebaseSimpleLogin.js

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -94,12 +94,14 @@
9494

9595
// Unauthenticate the Firebase reference.
9696
logout: function() {
97-
// Tell the simple login client to log us out.
98-
this._authClient.logout();
97+
if (this._currentUserData) {
98+
// Tell the simple login client to log us out.
99+
this._authClient.logout();
99100

100-
// Forget who we were, so that any getCurrentUser calls will wait for
101-
// another user event.
102-
delete this._currentUserData;
101+
// Forget who we were, so that any getCurrentUser calls will wait for
102+
// another user event.
103+
delete this._currentUserData;
104+
}
103105
},
104106

105107
// Creates a user for Firebase Simple Login. Function 'cb' receives an
@@ -231,4 +233,4 @@
231233
}
232234
}
233235
};
234-
})();
236+
})();

0 commit comments

Comments
 (0)