Fix JS sign-out

Closes #2991.