This repository was archived by the owner on Mar 17, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +5
-15
lines changed
Expand file tree Collapse file tree 1 file changed +5
-15
lines changed Original file line number Diff line number Diff line change 9494
9595 // Unauthenticate the Firebase reference.
9696 logout : function ( ) {
97- // Tell the simple login client to log us out.
98- this . _authClient . logout ( ) ;
99-
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 ;
97+ // Simple Login fires _onLoginEvent() even if no user is logged in. We don't care about
98+ // firing this logout event multiple times, so explicitly check if a user is defined.
99+ if ( this . _currentUserData ) {
100+ this . _authClient . logout ( ) ;
101+ }
104102 } ,
105103
106104 // Creates a user for Firebase Simple Login. Function 'cb' receives an
195193
196194 // Internal callback for any Simple Login event.
197195 _onLoginEvent : function ( err , user ) {
198- // HACK -- calls to logout() trigger events even if we're not logged in,
199- // making us get extra events. Throw them away. This should be fixed by
200- // changing Simple Login so that its callbacks refer directly to the
201- // action that caused them.
202- if ( this . _currentUserData === user && err === null ) {
203- return ;
204- }
205-
206196 var self = this ;
207197 if ( err ) {
208198 if ( self . _loginDeferred ) {
You can’t perform that action at this time.
0 commit comments