From ac29ca02243a51144de2fa21cfd44d576f4666dd Mon Sep 17 00:00:00 2001 From: Girish Ramakrishnan Date: Wed, 30 Mar 2022 11:42:30 -0700 Subject: [PATCH] restore: reset the mountOptions password --- src/js/restore.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/js/restore.js b/src/js/restore.js index 4d2acbe3f..9d18af0f4 100644 --- a/src/js/restore.js +++ b/src/js/restore.js @@ -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]);