Skip to content

Commit

Permalink
[PM-7186] Fallback to password list on exception (#3127)
Browse files Browse the repository at this point in the history
* PM-7186 Added fallback in case of exception that loads password list

* PM-7186 Added back the error message removed in last commit.
  • Loading branch information
dinisvieira committed Apr 2, 2024
1 parent 4633fea commit 856a084
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
7 changes: 6 additions & 1 deletion src/iOS.Autofill/LoginListViewController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -215,9 +215,14 @@ public async Task DoFido2GetAssertionAsync(IFido2GetAssertionUserInterface fido2
{
if (Context?.IsExecutingWithoutUserInteraction == false)
{
await _platformUtilsService.Value.ShowDialogAsync(
_ = _platformUtilsService.Value.ShowDialogAsync(
string.Format(AppResources.ThereWasAProblemReadingAPasskeyForXTryAgainLater, Context.PasskeyCredentialRequestParameters.RelyingPartyIdentifier),
AppResources.ErrorReadingPasskey);

TableView.SectionHeaderHeight = 0;
Context.IsPasswordFallback = true;
await ReloadItemsAsync();
_alreadyLoadItemsOnce = true;
}
}
catch (Exception ex)
Expand Down
4 changes: 3 additions & 1 deletion src/iOS.Autofill/Models/Context.cs
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,9 @@ public ASPasskeyCredentialIdentity PasskeyCredentialIdentity

public bool IsPasskey => PasskeyCredentialRequest != null;

public bool IsPreparingListForPasskey => PasskeyCredentialRequestParameters != null;
public bool IsPasswordFallback { get; set; }

public bool IsPreparingListForPasskey => PasskeyCredentialRequestParameters != null && !IsPasswordFallback;

public bool IsCreatingOrPreparingListForPasskey => IsCreatingPasskey || IsPreparingListForPasskey;
}
Expand Down

0 comments on commit 856a084

Please sign in to comment.