Make login mocking more generic