summaryrefslogtreecommitdiff
path: root/include/token_authorization_middleware.hpp
diff options
context:
space:
mode:
Diffstat (limited to 'include/token_authorization_middleware.hpp')
-rw-r--r--include/token_authorization_middleware.hpp24
1 files changed, 11 insertions, 13 deletions
diff --git a/include/token_authorization_middleware.hpp b/include/token_authorization_middleware.hpp
index 801c75f91b..7e8e5031ac 100644
--- a/include/token_authorization_middleware.hpp
+++ b/include/token_authorization_middleware.hpp
@@ -3,21 +3,19 @@
#include <crow/http_request.h>
#include <crow/http_response.h>
-namespace crow
-{
- struct TokenAuthorizationMiddleware {
+namespace crow {
+struct TokenAuthorizationMiddleware {
+ struct context {
+ std::unordered_map<std::string, std::string> cookie_sessions;
+ std::unordered_map<std::string, std::string> cookies_to_push_to_client;
- struct context {
- std::unordered_map<std::string, std::string> cookie_sessions;
- std::unordered_map<std::string, std::string> cookies_to_push_to_client;
+ std::string get_cookie(const std::string& key);
- std::string get_cookie(const std::string& key);
+ void set_cookie(const std::string& key, const std::string& value);
+ };
- void set_cookie(const std::string& key, const std::string& value);
- };
+ void before_handle(crow::request& req, response& res, context& ctx);
- void before_handle(crow::request& req, response& res, context& ctx);
-
- void after_handle(request& req, response& res, context& ctx);
- };
+ void after_handle(request& req, response& res, context& ctx);
+};
} \ No newline at end of file