added CORS
This commit is contained in:
24
source/login/login.hpp
Normal file
24
source/login/login.hpp
Normal 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__
|
||||
Reference in New Issue
Block a user