onLoginStatusChange bug

In `onLoginStatusChange`, you determine the current state and what event to trigger, however, you trigger the event *before* updating the value of `this._loginStatus`.

This results in unexpected behavior when you listen to the events sent by `onLoginStatusChange` and use `isConnected()` in the event handler.

I fixed it by updating the value before triggering the event.

No tests had to be updated.