File tree 1 file changed +7
-3
lines changed
1 file changed +7
-3
lines changed Original file line number Diff line number Diff line change @@ -50,14 +50,18 @@ function pacoteOpts (moreOpts) {
50
50
51
51
npm . config . keys . forEach ( function ( k ) {
52
52
const authMatch = k [ 0 ] === '/' && k . match (
53
- / ( .* ) : ( _ a u t h T o k e n | u s e r n a m e | _ p a s s w o r d | p a s s w o r d | e m a i l | a l w a y s - a u t h | a l w a y s A u t h ) $ /
53
+ / ( .* ) : ( _ a u t h T o k e n | u s e r n a m e | _ p a s s w o r d | p a s s w o r d | e m a i l | a l w a y s - a u t h ) $ /
54
54
)
55
55
if ( authMatch ) {
56
56
const nerfDart = authMatch [ 1 ]
57
57
const key = authMatch [ 2 ]
58
58
const val = npm . config . get ( k )
59
59
if ( ! opts . auth ) { opts . auth = { } }
60
- if ( ! opts . auth [ nerfDart ] ) { opts . auth [ nerfDart ] = { } }
60
+ if ( ! opts . auth [ nerfDart ] ) {
61
+ opts . auth [ nerfDart ] = {
62
+ alwaysAuth : ! ! npm . config . get ( 'always-auth' )
63
+ }
64
+ }
61
65
if ( key === '_authToken' ) {
62
66
opts . auth [ nerfDart ] . token = val
63
67
} else if ( key . match ( / p a s s w o r d $ / i) ) {
@@ -66,7 +70,7 @@ function pacoteOpts (moreOpts) {
66
70
// the actual username/password pair.
67
71
Buffer . from ( val , 'base64' ) . toString ( 'utf8' )
68
72
} else if ( key === 'always-auth' ) {
69
- opts . auth [ nerfDart ] . alwaysAuth = val
73
+ opts . auth [ nerfDart ] . alwaysAuth = val === 'false' ? false : ! ! val
70
74
} else {
71
75
opts . auth [ nerfDart ] [ key ] = val
72
76
}
You can’t perform that action at this time.
0 commit comments