blob: 801c75f91bb5e5267b385b6f1d8485f225d51f29 [file] [log] [blame]
Ed Tanousf9273472017-02-28 16:05:13 -08001#pragma once
2
3#include <crow/http_request.h>
4#include <crow/http_response.h>
5
6namespace crow
7{
8 struct TokenAuthorizationMiddleware {
9
10 struct context {
11 std::unordered_map<std::string, std::string> cookie_sessions;
12 std::unordered_map<std::string, std::string> cookies_to_push_to_client;
13
14 std::string get_cookie(const std::string& key);
15
16 void set_cookie(const std::string& key, const std::string& value);
17 };
18
19 void before_handle(crow::request& req, response& res, context& ctx);
20
21 void after_handle(request& req, response& res, context& ctx);
22 };
23}