Fix login not working first time in Chrome app

Closes #362