org import from lastpass

This commit is contained in:
Kyle Spearrin 2017-09-06 10:50:05 -04:00
parent aaa91e50b7
commit 2b6d7ec361
2 changed files with 16 additions and 4 deletions

View File

@ -17,6 +17,15 @@
instructions: $sce.trustAsHtml('Export using the web vault (vault.bitwarden.com). ' +
'Log into the web vault and navigate to your organization\'s admin area. Then to go ' +
'"Settings" > "Tools" > "Export".')
},
{
id: 'lastpass',
name: 'LastPass (csv)',
featured: true,
sort: 2,
instructions: $sce.trustAsHtml('See detailed instructions on our help site at ' +
'<a target="_blank" href="https://help.bitwarden.com/article/import-from-lastpass/">' +
'https://help.bitwarden.com/article/import-from-lastpass/</a>')
}
];
@ -66,7 +75,7 @@
collectionRelationships: collectionRelationships
}, function () {
$uibModalInstance.dismiss('cancel');
$state.go('backend.user.vault', { refreshFromServer: true }).then(function () {
$state.go('backend.org.vault', { orgId: $state.params.orgId }).then(function () {
$analytics.eventTrack('Imported Org Data', { label: $scope.model.source });
toastr.success('Data has been successfully imported into your vault.', 'Import Success');
});

View File

@ -15,7 +15,7 @@
importBitwardenCsv(file, success, error);
break;
case 'lastpass':
importLastPass(file, success, error);
importLastPass(file, success, error, false);
break;
case 'safeincloudxml':
importSafeInCloudXml(file, success, error);
@ -119,6 +119,9 @@
case 'bitwardencsv':
importBitwardenOrgCsv(file, success, error);
break;
case 'lastpass':
importLastPass(file, success, error, true);
break;
default:
error();
break;
@ -346,7 +349,7 @@
});
}
function importLastPass(file, success, error) {
function importLastPass(file, success, error, org) {
if (typeof file !== 'string' && file.type && file.type === 'text/html') {
var reader = new FileReader();
reader.readAsText(file, 'utf-8');
@ -424,7 +427,7 @@
}
logins.push({
favorite: value.fav === '1',
favorite: org ? false : value.fav === '1',
uri: value.url && value.url !== '' ? trimUri(value.url) : null,
username: value.username && value.username !== '' ? value.username : null,
password: value.password && value.password !== '' ? value.password : null,