
const logoutCtr = (req, res) => {
    let _resp_json = {
        result: "ok",
        reason: "",
        data: {},
        req_body: {},
        req_param: {}
    }
    //해당 쿠키 로그아웃
    let _cookie_name = _SPM.uac._config.cookie_name;
    let _isCookie = (req.cookies.SPM!=undefined) ? true : false;
    if (_isCookie) {
        res.clearCookie(_cookie_name);
        _resp_json.result = 'ok';
        _resp_json.reason = `cookie is deleted`
    }
    else {
        _resp_json.result = 'fail';
        _resp_json.reason = `cookie is NOT deleted`
    }
    res.status(200).json(_resp_json);
}

module.exports = logoutCtr;