diff --git a/install/generator-cyphernode/generators/app/lib/htpasswd.js b/install/generator-cyphernode/generators/app/lib/htpasswd.js index 7531794..1a0f612 100644 --- a/install/generator-cyphernode/generators/app/lib/htpasswd.js +++ b/install/generator-cyphernode/generators/app/lib/htpasswd.js @@ -6,8 +6,10 @@ module.exports = async ( password ) => { return null; } + password = password.replace(/'/g, `'\\''`); + return await new Promise( (resolve) => { - exec('htpasswd -bnB admin '+password+' | cut -sd \':\' -f2', (error, stdout, stderr) => { + exec('htpasswd -bnB admin \''+password+'\' | cut -sd \':\' -f2', (error, stdout, stderr) => { if (error) { return resolve(null); }