25 lines
491 B
C++
25 lines
491 B
C++
#ifndef __LOGIN_H__
|
|
#define __LOGIN_H__
|
|
|
|
#pragma once
|
|
|
|
#include <crow/http_response.h>
|
|
#include <crow/app.h>
|
|
#include "crow/middlewares/cors.h"
|
|
|
|
namespace login {
|
|
|
|
void initLogin(crow::App<crow::CORSHandler>& 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__
|