Our sign-in/sign-out code is a bit of a mess, and its difficult to cleanly do it right at the moment. It felt too complex to do to and fix this in this PR.