Login state management added; fixed a bug where the login ui elements were not being reset after login