"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.getAuthedImageUrl = getAuthedImageUrl;
const cacheBustUrl_1 = require("../../urls/cacheBustUrl");
/**
 * Get the image url with token if authenticated,
 * return the original url otherwise
 * @param url image url
 * @param requestOptions
 */
function getAuthedImageUrl(url, requestOptions) {
    let token;
    if (requestOptions.authentication) {
        const session = requestOptions.authentication;
        token = session.token;
    }
    const queryParams = requestOptions.authentication ? `?token=${token}` : "";
    return url && (0, cacheBustUrl_1.cacheBustUrl)(`${url}${queryParams}`);
}
//# sourceMappingURL=getAuthedImageUrl.js.map