gatekeeper prompts now ask for confirmation of the keys archive password

This commit is contained in:
jash
2018-11-03 17:39:17 +01:00
committed by kexkey
parent 3df176a4df
commit 51235d2e06

View File

@@ -23,6 +23,8 @@ const hasCert = function( props ) {
props.gatekeeper_sslcert
}
let password = '';
module.exports = {
name: function() {
return name;
@@ -37,6 +39,24 @@ module.exports = {
filter: utils._trimFilter,
validate: utils._notEmptyValidator
},
{
when: function( props ) {
// hacky hack
password = props.gatekeeper_clientkeyspassword;
return true;
},
type: 'password',
name: 'gatekeeper_clientkeyspassword_c',
default: utils._getDefault( 'gatekeeper_clientkeyspassword_c' ),
message: prefix()+'Config your client keys password.'+utils._getHelp('gatekeeper_clientkeyspassword_c'),
filter: utils._trimFilter,
validate: function( input ) {
if(input !== password) {
throw new Error( 'Client keys passwords do not match' );
}
return true;
}
},
{
when: function() { return hasAuthKeys( utils.props ); },
type: 'confirm',