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

Conversation

@jwngr
Copy link

@jwngr jwngr commented Oct 10, 2014

@katowulf - This fixes #431. We used to set this._currentUserData to undefined every time $logout() was called. This worked in most cases since the called to this._authClient.logout() ended up firing out _onLoginEvent() callback which set this._currentUserData to null and resolved any leftover getCurrentUser() promises. However, if we called this._authClient.logout() when we were already logged out, Simple Login does not fire the _onLoginEvent() callback and this._currentUserData gets stuck as undefined, which causes problems for logging in and getting the current user. Having this._currentUserData as undefined should only be valid at the very initializing of this service. It should always otherwise be null or a valid user object. As a result, this change just sets it to null when we call $logout().

cc/ @davideast

@katowulf
Copy link
Contributor

Great detective work! Looks ☃

katowulf added a commit that referenced this pull request Oct 10, 2014
Fixed bug from calling $logout() multiple times
@katowulf katowulf merged commit 006135f into master Oct 10, 2014
@katowulf katowulf deleted the jw-logout-bug branch October 10, 2014 19:13
@coveralls
Copy link

Coverage Status

Coverage remained the same when pulling 766495b on jw-logout-bug into 9eeaa5c on master.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

auth logout resolve issue

3 participants