Don't crash when tapping the Log in button twice (and simplify the code)