combine onLogin and onLoginFailure in docs.