async Task SignInIfCredentialsOK(UserLoginModel model) { UserSignInResult result = await identityProvider.CheckSignInAsync(model.Username, model.Password); if (result == UserSignInResult.Success) { await SignInUserAsync(model); } else if (result == UserSignInResult.Invalid) { throw new InvalidOperationException($"Invalid result received form {nameof(identityProvider)}."); } else { errorCollector.AddError(errorCreator.Create(result)); errorCollector.Save(); NavigateTo(NavigationLocation.Current); } }