1
0
mirror of https://github.com/bitwarden/mobile synced 2026-01-17 16:03:46 +00:00

[PM-6655] Add username empty fallback on passkey (#3101)

* PM-6655 Added fallback "Unknown account" to passkey username and moved it so it can be shared with Android

* PM-6655 Improved code lines formatting
This commit is contained in:
Federico Maccaroni
2024-03-21 13:56:37 -03:00
committed by GitHub
parent b931263662
commit ff49d041be
5 changed files with 31 additions and 18 deletions

View File

@@ -2,6 +2,7 @@
using Bit.Core.Abstractions;
using Bit.Core.Enums;
using Bit.Core.Models.View;
using Bit.Core.Resources.Localization;
using Bit.Core.Services;
using Bit.Core.Utilities;
using Foundation;
@@ -148,19 +149,8 @@ namespace Bit.iOS.Core.Utilities
return null;
}
var userName = cipher.Login.MainFido2Credential.UserName;
if (string.IsNullOrWhiteSpace(userName))
{
userName = cipher.Login.MainFido2Credential.UserDisplayName;
if (string.IsNullOrWhiteSpace(userName))
{
userName = cipher.Login.Username;
}
}
return new ASPasskeyCredentialIdentity(cipher.Login.MainFido2Credential.RpId,
userName,
cipher.Login.GetMainFido2CredentialUsername(),
NSData.FromArray(cipher.Login.MainFido2Credential.CredentialId.GuidToRawFormat()),
cipher.Login.MainFido2Credential.UserHandle,
cipher.Id);