diff --git a/src/main.cpp b/src/main.cpp index 3e3f943..47d4aba 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -341,13 +341,16 @@ int main(int argc, char *argv[]) { * Page for freelancer to sign up */ CROW_ROUTE(app, "/freelancer/signup") - ([]() { - - //todo:check logged in - + ([&, configuration](const crow::request& getRequest ) { + auto& ctx = app.get_context(getRequest); + string loginKey = ctx.get_cookie("loginKey"); + string freelancerEmail = ctx.get_cookie("freelancerEmail"); string templateHTML = "freelancer_Signup.html"; + if (!freelancerEmail.empty() && !loginKey.empty()) { + if (Utilities::checkFreelancerLoginState(configuration, loginKey, freelancerEmail)) + templateHTML = "freelancer_Redirect_Profile.html"; + } auto page = crow::mustache::load(templateHTML); - return page.render(); });