Redirect users to login instead of throwing a JS error. Add a unit test for it.

Summary: Redirect users to login instead of throwing a JS error. Add a unit test for it.

Test Plan: Unit test, tested locally.

Reviewers: cramer

Reviewed By: cramer

Subscribers: cf

Maniphest Tasks: T12109

Differential Revision: https://tails.corp.dropbox.com/D59108