Fix "Hitting login twice causes undefined behavior"
(https://trello.com/c/aQc6OaJT/44-hitting-login-twice-causes-undefined-behavior)