/*
 * @Author: Your Name lishengyin@sz-sunwin.com
 * @Date: 2022-06-15 22:40:47
 * @LastEditors: lishengyin
 * @LastEditTime: 2022-06-16 08:51:42
 * @FilePath: /ins/source/filters/src/LoginFilter.cc
 * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
 */
/**
 *
 *  LoginFilter.cc
 *
 */

#include "LoginFilter.hpp"

using namespace drogon;

void LoginFilter::doFilter(const HttpRequestPtr &req,
                         FilterCallback &&fcb,
                         FilterChainCallback &&fccb)
{
    //Edit your logic here
    if (1)
    {
        //Passed
        fccb();
        return;
    }
    //Check failed
    auto res = drogon::HttpResponse::newHttpResponse();
    res->setStatusCode(k500InternalServerError);
    fcb(res);
}
