tests/refac: pushing some login logic into login_manager