Skip to content
This repository has been archived by the owner on Aug 11, 2022. It is now read-only.

Commit

Permalink
Use the new /-/user api instead of deprecated ones.
Browse files Browse the repository at this point in the history
  • Loading branch information
isaacs committed Dec 4, 2010
1 parent c85de37 commit 2a31714
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion lib/owner.js
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ function rm (user, pkg, cb) {
}, cb)
}
function mutate (pkg, user, mutation, cb) {
get("/getuser/org.couchdb.user:"+user, function (er, u) {
get("/-/user/org.couchdb.user:"+user, function (er, u) {
if (er) return log.er(cb, "Error getting user data for "+user)(er)
if (!u || u.error) return cb(new Error(
"Couldn't get user data for "+user+": "+JSON.stringify(u)))
Expand Down
6 changes: 3 additions & 3 deletions lib/utils/registry/adduser.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ function adduser (username, password, email, cb) {
cb = done(cb)
log.verbose(userobj, "before first PUT")
request.PUT
( '/adduser/org.couchdb.user:'+encodeURIComponent(username)
( '/-/user/org.couchdb.user:'+encodeURIComponent(username)
, userobj
, function (error, data, json, response) {
// if it worked, then we just created a new user, and all is well.
Expand All @@ -52,13 +52,13 @@ function adduser (username, password, email, cb) {
}
log.verbose("update existing user", "adduser")
return request.GET
( '/getuser/org.couchdb.user:'+encodeURIComponent(username)
( '/-/user/org.couchdb.user:'+encodeURIComponent(username)
, function (er, data, json, response) {
userobj._rev = data._rev
userobj.roles = data.roles
log.verbose(userobj, "userobj")
request.PUT
( '/adduser/org.couchdb.user:'+encodeURIComponent(username)
( '/-/user/org.couchdb.user:'+encodeURIComponent(username)
+ "/-rev/" + userobj._rev
, userobj
, cb
Expand Down

0 comments on commit 2a31714

Please sign in to comment.