added CORS

This commit is contained in:
2026-02-16 23:24:31 +01:00
parent 14b8234e77
commit 58d37b51b7
27 changed files with 80 additions and 32 deletions

24
source/login/login.hpp Normal file
View File

@@ -0,0 +1,24 @@
#ifndef __LOGIN_H__
#define __LOGIN_H__
#pragma once
#include <crow.h>
#include "cors.h"
namespace login {
void initLogin(crow::App<CORS>& app);
std::optional<crow::response> isLoggedIn(const crow::request& req);
#define LOGGIN_REQUIERED(reg) \
{ \
auto res = login::isLoggedIn(req); \
if (res.has_value()) { \
return std::move(res.value()); \
} \
}
}
#endif // __LOGIN_H__