@@ -135,8 +135,8 @@ export function getNpmPackageJson(
135
135
getNpmConfigOption ( 'https-proxy' ) ,
136
136
getNpmConfigOption ( 'strict-ssl' ) ,
137
137
getNpmConfigOption ( 'cafile' ) ,
138
- getNpmConfigOption ( '_auth' , registryKey , true ) ,
139
- getNpmConfigOption ( '_authToken' , registryKey , true ) ,
138
+ getNpmConfigOption ( '_auth' ) ,
139
+ getNpmConfigOption ( '_authToken' , registryKey ) ,
140
140
getNpmConfigOption ( 'username' , registryKey , true ) ,
141
141
getNpmConfigOption ( 'password' , registryKey , true ) ,
142
142
getNpmConfigOption ( 'alwaysAuth' , registryKey , true ) ,
@@ -159,13 +159,24 @@ export function getNpmPackageJson(
159
159
160
160
const sslOptions = getNpmClientSslOptions ( strictSsl , cafile ) ;
161
161
162
- let auth ;
162
+ const auth : {
163
+ token ?: string ,
164
+ alwaysAuth ?: boolean ;
165
+ username ?: string ;
166
+ password ?: string
167
+ } = { } ;
168
+
169
+ if ( alwaysAuth !== undefined ) {
170
+ auth . alwaysAuth = alwaysAuth === 'false' ? false : ! ! alwaysAuth ;
171
+ }
172
+
163
173
if ( authToken ) {
164
- auth = { token : authToken , alwaysAuth } ;
174
+ auth . token = authToken ;
165
175
} else if ( token ) {
166
- auth = { token, alwaysAuth } ;
176
+ auth . token = token ;
167
177
} else if ( username ) {
168
- auth = { username, password, alwaysAuth } ;
178
+ auth . username = username ;
179
+ auth . password = password ;
169
180
}
170
181
171
182
const client = new RegistryClient ( {
0 commit comments