diff options
Diffstat (limited to 'lib/utils/npm-registry-client/adduser.js')
-rw-r--r-- | lib/utils/npm-registry-client/adduser.js | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/lib/utils/npm-registry-client/adduser.js b/lib/utils/npm-registry-client/adduser.js index 5e6794a75..0dc582395 100644 --- a/lib/utils/npm-registry-client/adduser.js +++ b/lib/utils/npm-registry-client/adduser.js @@ -3,7 +3,7 @@ module.exports = adduser var uuid = require("node-uuid") , request = require("./request.js") - , log = require("../log.js") + , log = require("npmlog") , npm = require("../../npm.js") , crypto @@ -43,7 +43,7 @@ function adduser (username, password, email, cb) { , date: new Date().toISOString() } cb = done(cb) - log.verbose(userobj, "before first PUT") + log.verbose("adduser", "before first PUT", userobj) request.PUT ( '/-/user/org.couchdb.user:'+encodeURIComponent(username) , userobj @@ -61,13 +61,13 @@ function adduser (username, password, email, cb) { if (!error || !response || response.statusCode !== 409) { return cb(error, data, json, response) } - log.verbose("update existing user", "adduser") + log.verbose("adduser", "update existing user") return request.GET ( '/-/user/org.couchdb.user:'+encodeURIComponent(username) , function (er, data, json, response) { userobj._rev = data._rev userobj.roles = data.roles - log.verbose(userobj, "userobj") + log.verbose("adduser", "userobj", userobj) request.PUT ( '/-/user/org.couchdb.user:'+encodeURIComponent(username) + "/-rev/" + userobj._rev @@ -83,14 +83,14 @@ function done (cb) { return function (error, data, json, response) { if (!error && (!response || response.statusCode === 201)) { return cb(error, data, json, response) } - log.verbose([error, data, json], "back from adduser") + log.verbose("adduser", "back", [error, data, json]) if (!error) { error = new Error( (response && response.statusCode || "") + " "+ "Could not create user\n"+JSON.stringify(data)) } if (response && (response.statusCode === 401 || response.statusCode === 403)) { - log.warn("Incorrect username or password\n" + log.warn("adduser", "Incorrect username or password\n" +"You can reset your account by visiting:\n" +"\n" +" http://admin.npmjs.org/reset\n") |