refactor: log npm auth

This commit is contained in:
Rhys Arkins 2019-01-24 12:59:14 +01:00
parent 10b52cf93b
commit 048fd66124

View file

@ -67,6 +67,10 @@ async function getDependency(name, maxRetries = 5) {
authInfo.type = 'Basic'; authInfo.type = 'Basic';
} }
headers.authorization = `${authInfo.type} ${authInfo.token}`; headers.authorization = `${authInfo.type} ${authInfo.token}`;
logger.debug(
{ token: maskToken(authInfo.token), npmName: name },
'Using auth for npm lookup'
);
} else if (process.env.NPM_TOKEN && process.env.NPM_TOKEN !== 'undefined') { } else if (process.env.NPM_TOKEN && process.env.NPM_TOKEN !== 'undefined') {
headers.authorization = `Bearer ${process.env.NPM_TOKEN}`; headers.authorization = `Bearer ${process.env.NPM_TOKEN}`;
} }