refactored loginUser method, added noty to login/registration