update deps

This commit is contained in:
2026-02-22 13:20:41 +01:00
parent ce20ca6b35
commit ea90f8bc7f
3 changed files with 6 additions and 15 deletions

View File

@@ -68,6 +68,9 @@ add_executable(${TARGET_NAME}
source/login/SessionHandler.cpp source/login/SessionHandler.cpp
) )
# requiered packages
target_compile_definitions(${TARGET_NAME} PRIVATE ASIO_STANDALONE)
# warnings to ignore # warnings to ignore
target_compile_options(${TARGET_NAME} PRIVATE target_compile_options(${TARGET_NAME} PRIVATE
$<$<COMPILE_LANGUAGE:CXX>: $<$<COMPILE_LANGUAGE:CXX>:

View File

@@ -77,9 +77,6 @@ void initLogin(crow::App<crow::CORSHandler>& app){
"; HttpOnly; Path=/; SameSite=Strict" "; HttpOnly; Path=/; SameSite=Strict"
// add "; Secure" when using HTTPS // add "; Secure" when using HTTPS
); );
res.set_header("Access-Control-Allow-Credentials", "true");
res.set_header("Access-Control-Allow-Origin", "http://localhost:5173");
res.body = "Logged in"; res.body = "Logged in";
return res; return res;
}); });

View File

@@ -18,7 +18,9 @@ int main() {
cors.global() cors.global()
.headers("Content-Type", "Authorization") .headers("Content-Type", "Authorization")
.methods("GET"_method, "POST"_method, "PUT"_method, "DELETE"_method, "OPTIONS"_method) .methods("GET"_method, "POST"_method, "PUT"_method, "DELETE"_method, "OPTIONS"_method)
.origin(settings.domain); .allow_credentials()
.origin(settings.domain)
.max_age(86400);
// create global database // create global database
dbpool = std::make_unique<DatabasePool>(settings.db_path); dbpool = std::make_unique<DatabasePool>(settings.db_path);
@@ -39,17 +41,6 @@ int main() {
return 1; return 1;
} }
// options path
CROW_ROUTE(app, "/<path>") .methods("OPTIONS"_method)
([&settings](const crow::request&, crow::response& res, const std::string&) {
res.add_header("Access-Control-Allow-Origin", settings.domain);
res.add_header("Access-Control-Allow-Methods", "GET, POST, PUT, DELETE, OPTIONS");
res.add_header("Access-Control-Allow-Headers", "Content-Type, Authorization");
res.add_header("Access-Control-Max-Age", "86400"); // Cache preflight for 24h
res.code = 204;
res.end();
});
// Root route // Root route
CROW_ROUTE(app, "/")([&]() { CROW_ROUTE(app, "/")([&]() {
return utils::getFile(utils::build_dir / "index.html"); return utils::getFile(utils::build_dir / "index.html");