Removed onLoginByKeyFailure and bug related to its implementation.