import { cacheBustUrl } from "../../urls/cacheBustUrl";
/**
 * Get the image url with token if authenticated,
 * return the original url otherwise
 * @param url image url
 * @param requestOptions
 */
export function getAuthedImageUrl(url, requestOptions) {
    let token;
    if (requestOptions.authentication) {
        const session = requestOptions.authentication;
        token = session.token;
    }
    const queryParams = requestOptions.authentication ? `?token=${token}` : "";
    return url && cacheBustUrl(`${url}${queryParams}`);
}
//# sourceMappingURL=getAuthedImageUrl.js.map