warn about outdated npm in adduser

close #93
This commit is contained in:
Alex Kocharin 2014-11-12 18:01:59 +03:00
parent 037b3aea6a
commit 31bd3c9db7
1 changed files with 5 additions and 1 deletions

View File

@ -194,7 +194,11 @@ module.exports = function(config_hash) {
})
} else {
if (typeof(req.body.name) !== 'string' || typeof(req.body.password) !== 'string') {
return next( Error[400]('user/password is not found in request (npm issue?)') )
if (typeof(req.body.password_sha)) {
return next( Error[422]("your npm version is outdated\nPlease update to npm@1.4.5 or greater.\nSee https://github.com/rlidwka/sinopia/issues/93 for details.") )
} else {
return next( Error[422]('user/password is not found in request (npm issue?)') )
}
}
auth.add_user(req.body.name, req.body.password, function(err) {
if (err) {