Skip to content

Commit 992799c

Browse files
committed
fix(login): properly save scope if defined
setCredentialsByURI was clobbering the saving of the scope:registry config PR-URL: #3383 Credit: @wraithgar Close: #3383 Reviewed-by: @nlf
1 parent 7d5b049 commit 992799c

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

lib/adduser.js

+1-3
Original file line numberDiff line numberDiff line change
@@ -75,11 +75,9 @@ class AddUser extends BaseCommand {
7575

7676
async updateConfig ({ newCreds, registry, scope }) {
7777
this.npm.config.delete('_token', 'user') // prevent legacy pollution
78-
78+
this.npm.config.setCredentialsByURI(registry, newCreds)
7979
if (scope)
8080
this.npm.config.set(scope + ':registry', registry, 'user')
81-
82-
this.npm.config.setCredentialsByURI(registry, newCreds)
8381
await this.npm.config.save('user')
8482
}
8583
}

0 commit comments

Comments
 (0)