test error thrown from BeforeLogIn