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

Commit 006135f

Browse files
committed
Merge pull request #433 from firebase/jw-logout-bug
Fixed bug from calling $logout() multiple times
2 parents 9eeaa5c + 766495b commit 006135f

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

src/firebaseSimpleLogin.js

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -97,9 +97,10 @@
9797
// Tell the simple login client to log us out.
9898
this._authClient.logout();
9999

100-
// Forget who we were, so that any getCurrentUser calls will wait for
101-
// another user event.
102-
delete this._currentUserData;
100+
// Forget who we were immediately, so that any getCurrentUser() calls
101+
// will resolve the user as logged out even before the _onLoginEvent()
102+
// fires and resets this._currentUserData to null again.
103+
this._currentUserData = null;
103104
},
104105

105106
// Creates a user for Firebase Simple Login. Function 'cb' receives an
@@ -231,4 +232,4 @@
231232
}
232233
}
233234
};
234-
})();
235+
})();

0 commit comments

Comments
 (0)