Ensured logout completes before login attempt