1
0
mirror of https://github.com/bitwarden/mobile synced 2025-12-16 08:13:20 +00:00

PM-5154 [Passkeys iOS] Added custom UI flow for passkey creation

This commit is contained in:
Federico Maccaroni
2024-02-19 18:44:35 -03:00
parent c801b2fc3a
commit a4adcdcfd4
22 changed files with 648 additions and 105 deletions

View File

@@ -1286,6 +1286,34 @@ namespace Bit.Core.Services
cipher.PasswordHistory = encPhs;
}
public async Task<string> CreateNewLoginForPasskeyAsync(string rpId)
{
var newCipher = new CipherView
{
Name = rpId,
Type = CipherType.Login,
Login = new LoginView
{
Uris = new List<LoginUriView>
{
new LoginUriView { Uri = rpId }
}
},
Card = new CardView(),
Identity = new IdentityView(),
SecureNote = new SecureNoteView
{
Type = SecureNoteType.Generic
},
Reprompt = CipherRepromptType.None
};
var encryptedCipher = await EncryptAsync(newCipher);
await SaveWithServerAsync(encryptedCipher);
return encryptedCipher.Id;
}
private class CipherLocaleComparer : IComparer<CipherView>
{
private readonly II18nService _i18nService;