Add some login logic with partial test cases