apply login check optimization
This commit is contained in:
@ -540,13 +540,9 @@ int main(int argc, char *argv[]) {
|
||||
CROW_ROUTE(app, "/freelancer/signup")
|
||||
([&, configuration](const crow::request& getRequest ) {
|
||||
auto& ctx = app.get_context<crow::CookieParser>(getRequest);
|
||||
string loginKey = ctx.get_cookie("loginKey");
|
||||
string freelancerEmail = ctx.get_cookie("freelancerEmail");
|
||||
string templateHTML = TEMPLATE_FREELANCER_SIGN_UP;
|
||||
if (!freelancerEmail.empty() && !loginKey.empty()) {
|
||||
if (Utilities::checkFreelancerLoginState(configuration, loginKey, freelancerEmail))
|
||||
templateHTML = TEMPLATE_FREELANCER_REDIRECT_PROFILE;
|
||||
}
|
||||
if (Utilities::checkCookieLoginState(configuration, ctx))
|
||||
templateHTML = TEMPLATE_FREELANCER_REDIRECT_PROFILE;
|
||||
auto page = crow::mustache::load(templateHTML);
|
||||
return page.render();
|
||||
});
|
||||
|
Reference in New Issue
Block a user