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); }); }