Clean up login logic.