diff --git a/lib/imgur.js b/lib/imgur.js index 193d54cc..50fbab12 100644 --- a/lib/imgur.js +++ b/lib/imgur.js @@ -184,6 +184,17 @@ imgur._getAuthorizationHeader = async () => { return `Bearer ${imgurAccessToken}`; }; +/** + * Set your Authorization if authenticating separately + * @link https://api.imgur.com/#register + * @param {string} accessToken + */ +imgur.setAccessToken = function (accessToken) { + if (accessToken && typeof accessToken === 'string') { + imgurAccessToken = accessToken; + } +}; + /** * Set your credentials * @link https://api.imgur.com/#register