"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.handleLogout = handleLogout;
const oauth_1 = require("../components/oauth");
const yt_auth_1 = require("../components/yt-auth");
function handleLogout(req, res) {
    if ((0, oauth_1.isOAuthAllowed)(req) && (0, oauth_1.isUserOAuthLogged)(req)) {
        res.redirect((0, oauth_1.getOAuthLogoutPath)(req));
    }
    else if ((0, yt_auth_1.isYtAuthEnabled)(req.ctx.config)) {
        (0, yt_auth_1.YTAuthLogout)(res);
    }
    res.redirect('/');
}
