Skip to content

Commit 7309c91

Browse files
clydinfilipesilva
authored andcommitted
feat(@schematics/update): support npm auth bearer tokens
1 parent ff2bd3e commit 7309c91

File tree

1 file changed

+5
-1
lines changed
  • packages/schematics/update/update

1 file changed

+5
-1
lines changed

packages/schematics/update/update/npm.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,6 +136,7 @@ export function getNpmPackageJson(
136136
getNpmConfigOption('strict-ssl'),
137137
getNpmConfigOption('cafile'),
138138
getNpmConfigOption('_auth', registryKey, true),
139+
getNpmConfigOption('_authToken', registryKey, true),
139140
getNpmConfigOption('username', registryKey, true),
140141
getNpmConfigOption('password', registryKey, true),
141142
getNpmConfigOption('alwaysAuth', registryKey, true),
@@ -148,6 +149,7 @@ export function getNpmPackageJson(
148149
strictSsl,
149150
cafile,
150151
token,
152+
authToken,
151153
username,
152154
password,
153155
alwaysAuth,
@@ -158,7 +160,9 @@ export function getNpmPackageJson(
158160
const sslOptions = getNpmClientSslOptions(strictSsl, cafile);
159161

160162
let auth;
161-
if (token) {
163+
if (authToken) {
164+
auth = { token: authToken, alwaysAuth };
165+
} else if (token) {
162166
auth = { token, alwaysAuth };
163167
} else if (username) {
164168
auth = { username, password, alwaysAuth };

0 commit comments

Comments
 (0)