Fixed #82061 by listening to the loginstatechanged event.
Merge pull request #130 from luisromangz/8.5-SNAPSHOT-82061

Fixed #82061 by listening to the loginstatechanged event.