From 5b6172f01c88b73e83a75a508bbdcad92231ead5 Mon Sep 17 00:00:00 2001 From: Gar Date: Tue, 10 Oct 2023 11:41:41 -0700 Subject: [PATCH] fix: logout from custom registry --- lib/commands/logout.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/commands/logout.js b/lib/commands/logout.js index ef0f256568d2c..665580930639c 100644 --- a/lib/commands/logout.js +++ b/lib/commands/logout.js @@ -1,5 +1,5 @@ -const getAuth = require('npm-registry-fetch/lib/auth.js') const npmFetch = require('npm-registry-fetch') +const { getAuth } = npmFetch const log = require('../utils/log-shim') const BaseCommand = require('../base-command.js') @@ -26,6 +26,7 @@ class Logout extends BaseCommand { log.verbose('logout', `clearing token for ${reg}`) await npmFetch(`/-/user/token/${encodeURIComponent(auth.token)}`, { ...this.npm.flatOptions, + registry: reg, method: 'DELETE', ignoreBody: true, })