From 778775563fa8170d9c28df7661aa8053a27b8eeb Mon Sep 17 00:00:00 2001 From: Gar Date: Mon, 7 Jun 2021 15:56:04 -0700 Subject: [PATCH] fix(login): properly save scope if defined setCredentialsByURI was clobbering the saving of the scope:registry config --- lib/adduser.js | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/lib/adduser.js b/lib/adduser.js index fb1e323512b6d..e502276a1743c 100644 --- a/lib/adduser.js +++ b/lib/adduser.js @@ -75,11 +75,9 @@ class AddUser extends BaseCommand { async updateConfig ({ newCreds, registry, scope }) { this.npm.config.delete('_token', 'user') // prevent legacy pollution - + this.npm.config.setCredentialsByURI(registry, newCreds) if (scope) this.npm.config.set(scope + ':registry', registry, 'user') - - this.npm.config.setCredentialsByURI(registry, newCreds) await this.npm.config.save('user') } }