From 1df9ff58e3a4a0c99db08e6661a7b63febea5909 Mon Sep 17 00:00:00 2001 From: Saurabh Gupta <102164325+saurabh-gupta-pingsafe@users.noreply.github.com> Date: Sun, 22 Oct 2023 13:33:03 +0530 Subject: [PATCH] add support for azure access_token --- lib/registry-client-v2.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/registry-client-v2.js b/lib/registry-client-v2.js index e65df8d..5022999 100644 --- a/lib/registry-client-v2.js +++ b/lib/registry-client-v2.js @@ -345,11 +345,11 @@ function _getToken(opts, cb) { return cb(new errors.UnauthorizedError(errMsg)); } return cb(err); - } else if (!body.token) { + } else if (!body.token && !body.access_token) { return cb(new errors.UnauthorizedError(err, 'authorization ' + 'server did not include a token in the response')); } - cb(null, body.token); + cb(null, body.token || body.access_token); }); }