Move initial login check logic.