restore: reset the mountOptions password

This commit is contained in:
Girish Ramakrishnan
2022-03-30 11:42:30 -07:00
parent 75e8fc6cbd
commit ac29ca0224

View File

@@ -1,8 +1,6 @@
'use strict';
/* global angular */
/* global tld */
/* global $ */
/* global $, angular, tld, SECRET_PLACEHOLDER */
// create main application module
var app = angular.module('Application', ['pascalprecht.translate', 'ngCookies', 'angular-md5', 'ui-notification', 'ui.bootstrap']);
@@ -425,6 +423,9 @@ app.controller('RestoreController', ['$scope', 'Client', function ($scope, Clien
Object.keys(backupConfig).forEach(function (k) {
if (k in $scope) $scope[k] = backupConfig[k];
});
// this allows the config to potentially have a raw password (though our UI sets it to placeholder)
if ($scope.mountOptions.password === SECRET_PLACEHOLDER) $scope.mountOptions.password = '';
});
};
reader.readAsText(event.target.files[0]);