Ed Tanous | f927347 | 2017-02-28 16:05:13 -0800 | [diff] [blame] | 1 | #pragma once |
| 2 | |
| 3 | #include <crow/http_request.h> |
| 4 | #include <crow/http_response.h> |
| 5 | |
| 6 | namespace 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 | } |