"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.isYtAuthEnabled = isYtAuthEnabled;
exports.YTAuthLogout = YTAuthLogout;
const constants_1 = require("../../shared/constants");
const utils_1 = require("./utils");
const utils_2 = require("../utils");
function isYtAuthEnabled(config) {
    return Boolean(config.allowPasswordAuth);
}
function YTAuthLogout(res) {
    const clusters = (0, utils_1.getClustersFromConfig)();
    res.setHeader('set-cookie', [`${constants_1.YT_CYPRESS_COOKIE_NAME}=deleted; Path=/; Max-Age=0;`].concat(Object.keys(clusters).map((cluster) => `${(0, utils_2.makeAuthClusterCookieName)(cluster)}=deleted; Path=/; Max-Age=0;`)));
}
