
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;
    res.clearCookie(_cookie_name);
    _isCookie = (req.cookies.SPM==undefined) ? false : true;
    if (!_isCookie) {
        _resp_json.result = 'ok';
        _resp_json.reason = `'${_cookie_name}' cookie is deleted`
    }
    else {
        _resp_json.result = 'fail';
        _resp_json.reason = `'${_cookie_name}' cookie is NOT deleted`
    }
    res.status(200).json(_resp_json);
}

module.exports = logoutCtr;