1
0
mirror of https://github.com/bitwarden/mobile synced 2025-12-17 00:33:20 +00:00

support login uris from app extension

This commit is contained in:
Kyle Spearrin
2018-03-12 13:29:12 -04:00
parent b6a3a0a54f
commit 8fc95759ba
2 changed files with 28 additions and 4 deletions

View File

@@ -160,12 +160,23 @@ namespace Bit.iOS.Extension
Type = App.Enums.CipherType.Login,
Login = new Login
{
Uri = string.IsNullOrWhiteSpace(UriCell.TextField.Text) ? null : UriCell.TextField.Text.Encrypt(),
Uris = null,
Username = string.IsNullOrWhiteSpace(UsernameCell.TextField.Text) ? null : UsernameCell.TextField.Text.Encrypt(),
Password = string.IsNullOrWhiteSpace(PasswordCell.TextField.Text) ? null : PasswordCell.TextField.Text.Encrypt()
}
};
if(!string.IsNullOrWhiteSpace(UriCell.TextField.Text))
{
cipher.Login.Uris = new List<LoginUri>
{
new LoginUri
{
Uri = UriCell.TextField.Text.Encrypt()
}
};
}
var saveTask = _cipherService.SaveAsync(cipher);
var loadingAlert = Dialogs.CreateLoadingAlert(AppResources.Saving);
PresentViewController(loadingAlert, true, null);