fixed logout that broke after refactoring AGPUSH-1025

please merge to `1.0.x` and `master`