diff --git a/src/app/organization/organizationSettingsImportController.js b/src/app/organization/organizationSettingsImportController.js index cf2ca776..9031d7da 100644 --- a/src/app/organization/organizationSettingsImportController.js +++ b/src/app/organization/organizationSettingsImportController.js @@ -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 ' + + '' + + 'https://help.bitwarden.com/article/import-from-lastpass/') } ]; @@ -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'); }); diff --git a/src/app/services/importService.js b/src/app/services/importService.js index ee7a7939..83a21769 100644 --- a/src/app/services/importService.js +++ b/src/app/services/importService.js @@ -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,