diff options
author | Forrest L Norvell <forrest@npmjs.com> | 2015-02-13 14:49:48 +0300 |
---|---|---|
committer | Forrest L Norvell <forrest@npmjs.com> | 2015-02-13 14:49:48 +0300 |
commit | d0790dcf87ade85316aaac1700a7e9877c5c7127 (patch) | |
tree | e060e315e95ca6306e47d04355b2798421889254 /lib/config/clear-credentials-by-uri.js | |
parent | 4bf0f5d56c33649124b486e016ba4a620c105c1c (diff) |
config: clear credentials by nerf dart
Diffstat (limited to 'lib/config/clear-credentials-by-uri.js')
-rw-r--r-- | lib/config/clear-credentials-by-uri.js | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/lib/config/clear-credentials-by-uri.js b/lib/config/clear-credentials-by-uri.js new file mode 100644 index 000000000..88131f7ad --- /dev/null +++ b/lib/config/clear-credentials-by-uri.js @@ -0,0 +1,16 @@ +var assert = require("assert") + +var toNerfDart = require("./nerf-dart.js") + +module.exports = clearCredentialsByURI + +function clearCredentialsByURI (uri) { + assert(uri && typeof uri === "string", "registry URL is required") + + var nerfed = toNerfDart(uri) + + this.del(nerfed + ":_authToken", "user") + this.del(nerfed + ":_password", "user") + this.del(nerfed + ":username", "user") + this.del(nerfed + ":email", "user") +} |