File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -59,6 +59,7 @@ const adduser = async (args) => {
5959 log . notice ( '' , `Log in on ${ replaceInfo ( registry ) } ` )
6060
6161 const { message, newCreds } = await auth ( {
62+ ...npm . flatOptions ,
6263 creds,
6364 registry,
6465 scope,
Original file line number Diff line number Diff line change @@ -9,21 +9,27 @@ const _flatOptions = {
99 authType : 'legacy' ,
1010 registry : 'https://registry.npmjs.org/' ,
1111 scope : '' ,
12+ fromFlatOptions : true ,
1213}
1314
1415let failSave = false
1516let deletedConfig = { }
1617let registryOutput = ''
1718let setConfig = { }
18- const authDummy = ( ) => Promise . resolve ( {
19- message : 'success' ,
20- newCreds : {
21- username : 'u' ,
22- password : 'p' ,
23- email : 'u@npmjs.org' ,
24- alwaysAuth : false ,
25- } ,
26- } )
19+ const authDummy = ( options ) => {
20+ if ( ! options . fromFlatOptions )
21+ throw new Error ( 'did not pass full flatOptions to auth function' )
22+
23+ return Promise . resolve ( {
24+ message : 'success' ,
25+ newCreds : {
26+ username : 'u' ,
27+ password : 'p' ,
28+ email : 'u@npmjs.org' ,
29+ alwaysAuth : false ,
30+ } ,
31+ } )
32+ }
2733
2834const deleteMock = ( key , where ) => {
2935 deletedConfig = {
You can’t perform that action at this time.
0 commit comments