Fix login behavior