Skip to content

Commit 11ba713

Browse files
committed
logs if token exists
1 parent 159e40f commit 11ba713

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

lib/utils/oidc.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ async function oidc ({ packageName, registry, opts, config }) {
2222
* This code should never run when people try to publish locally on their machines.
2323
* It is designed to execute only in Continuous Integration (CI) environments.
2424
*/
25+
2526
try {
2627
if (!(
2728
/** @see https://github.com/watson/ci-info/blob/v4.2.0/vendors.json#L152 */
@@ -110,6 +111,13 @@ async function oidc ({ packageName, registry, opts, config }) {
110111
const regKey = `//${parsedRegistry.host}${parsedRegistry.pathname}`
111112
const authTokenKey = `${regKey}:_authToken`
112113

114+
const exitingToken = config.get(authTokenKey)
115+
if (exitingToken) {
116+
log.silly('oidc', 'Existing token found')
117+
} else {
118+
log.silly('oidc', 'No existing token found')
119+
}
120+
113121
const escapedPackageName = npa(packageName).escapedName
114122
const response = await npmFetch.json(new URL(`/-/npm/v1/oidc/token/exchange/package/${escapedPackageName}`, registry), {
115123
...{

0 commit comments

Comments
 (0)