adapt_authoring
adapt_authoring copied to clipboard
Install script shouldn't fail on incorrect password
Expected Behaviour
The script allows infinite attempts to retype the password, until the user exits the script.
Actual Behaviour
If the passwords don't match, the script logs an error and exits.
Steps to Reproduce
- Run install script
- Enter incorrect password when asked to
Confirm Password
Versions
- Authoring Tool Version: 0.4.0
This might be a simple way to keep checking the password.
https://github.com/adaptlearning/adapt_authoring/blob/master/install.js#L483-L503
var comparePass = function(pass, retype) {
if ( pass !== retype) {
console.log('Passwords do not match, please try again.');
installHelpers.getInput([inputData.superUser[1], inputData.superUser[2]], function(res) {
comparePass(res.suPassword, res.suRetypePassword);
}
} else {
app.usermanager.deleteUser({ email: result.suEmail }, function(error, userRec) {
if(error) return onError(error);
// add a new user using default auth plugin
new localAuth().internalRegisterUser(true, {
email: result.suEmail,
password: pass,
retypePassword: pass,
_tenantId: masterTenant._id
}, function(error, user) {
if(error) {
return onError(error);
}
superUser = user;
helpers.grantSuperPermissions(user._id, function(error) {
if(error) return onError(error);
return callback();
});
});
});
}
}
console.log('');
comparePass(result.suPassword, result.suRetypePassword)
@taylortom any news on this? Absolute nightmare when you mistype :(