npm-registry-client
Advanced tools
Comparing version 0.2.1 to 0.2.5
@@ -1,10 +0,5 @@ | ||
module.exports = adduser | ||
var uuid = require("node-uuid") | ||
, crypto | ||
var crypto = require('crypto') | ||
try { | ||
} catch (ex) {} | ||
function sha (s) { | ||
@@ -15,3 +10,2 @@ return crypto.createHash("sha1").update(s).digest("hex") | ||
function adduser (username, password, email, cb) { | ||
if (!crypto) crypto = require("crypto") | ||
@@ -31,3 +25,3 @@ password = ("" + (password || "")).trim() | ||
var salt = uuid() | ||
var salt = crypto.randomBytes(30).toString('hex') | ||
, userobj = | ||
@@ -34,0 +28,0 @@ { name : username |
@@ -14,3 +14,5 @@ | ||
if (!email || !auth || !username) { | ||
return cb(new Error("auth and email required for publishing")) | ||
var er = new Error("auth and email required for publishing") | ||
er.code = 'ENEEDAUTH' | ||
return cb(er) | ||
} | ||
@@ -17,0 +19,0 @@ |
@@ -76,3 +76,4 @@ module.exports = regRequest | ||
// login to get a valid token | ||
var a = { name: this.username, password: this.password } | ||
var a = { name: this.conf.get('username'), | ||
password: this.conf.get('_password') } | ||
var args = arguments | ||
@@ -79,0 +80,0 @@ return this.couchLogin.login(a, function (er, cr, data) { |
@@ -5,3 +5,3 @@ | ||
function star (package, starred, cb) { | ||
if (!this.username) return cb(new Error( | ||
if (!this.conf.get('username')) return cb(new Error( | ||
"Must be logged in to star/unstar packages")) | ||
@@ -20,6 +20,6 @@ | ||
this.log.info("starring", fullData._id) | ||
fullData.users[this.username] = true | ||
fullData.users[this.conf.get('username')] = true | ||
this.log.verbose("starring", fullData) | ||
} else { | ||
delete fullData.users[this.username] | ||
delete fullData.users[this.conf.get('username')] | ||
this.log.info("unstarring", fullData._id) | ||
@@ -26,0 +26,0 @@ this.log.verbose("unstarring", fullData) |
@@ -5,3 +5,3 @@ { | ||
"description": "Client for the npm registry", | ||
"version": "0.2.1", | ||
"version": "0.2.5", | ||
"repository": { | ||
@@ -15,3 +15,2 @@ "url": "git://github.com/isaacs/npm-registry-client" | ||
"dependencies": { | ||
"node-uuid": "~1.3.3", | ||
"request": "~2.9.202", | ||
@@ -18,0 +17,0 @@ "graceful-fs": "~1.1.8", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
67506
10
1032
- Removednode-uuid@~1.3.3
- Removednode-uuid@1.3.3(transitive)