Fix login / logout on mobile

Fix #942