adding callback to settings.load, and omitting password validation check on user creation if no password is entered (e.g. SSO login)

v1.18.x
Julian Lam 11 years ago
parent cc0fabc619
commit da1a1d5930

@ -16,12 +16,15 @@
define(function() {
var Settings = {};
Settings.load = function(hash, formEl) {
Settings.load = function(hash, formEl, callback) {
socket.emit('admin.settings.get', {
hash: hash
}, function(err, values) {
if (!err) {
$(formEl).deserialize(values);
if (typeof callback === 'function') {
callback();
}
} else {
console.log('[settings] Unable to load settings for hash: ', hash);
}

@ -27,7 +27,11 @@ module.exports = function(User) {
next((!utils.isUserNameValid(userData.username) || !userData.userslug) ? new Error('Invalid Username!') : null);
},
function(next) {
if (userData.password) {
next(!utils.isPasswordValid(userData.password) ? new Error('Invalid Password!') : null);
} else {
next();
}
},
function(next) {
User.exists(userData.userslug, function(err, exists) {

Loading…
Cancel
Save