Skip to content

Commit 3738d66

Browse files
authored
Add support to pass auth_token (#290)
1 parent 5a4cc45 commit 3738d66

File tree

2 files changed

+12
-0
lines changed

2 files changed

+12
-0
lines changed

src/url.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -377,5 +377,9 @@ export default function url(publicId, options = {}, config = {}) {
377377
}
378378
resultUrl = `${resultUrl}${appender}_a=${sdkAnalyticsSignature}`;
379379
}
380+
if (options.auth_token) {
381+
let appender = resultUrl.indexOf('?') >= 0 ? '&' : '?';
382+
resultUrl = `${resultUrl}${appender}__cld_token__=${options.auth_token}`;
383+
}
380384
return resultUrl;
381385
};

test/spec/automatic/cloudinary-spec.js

Lines changed: 8 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)