pandemonium_engine/modules/web/http/csrf_token.h

32 lines
675 B
C++
Raw Normal View History

#ifndef CSRF_TOKEN_MIDDLEWARE_H
#define CSRF_TOKEN_MIDDLEWARE_H
#include "web_server_middleware.h"
#include "core/ustring.h"
#include "core/vector.h"
class WebServerRequest;
2022-06-26 15:00:25 +02:00
class CSRFTokenWebServerMiddleware : public WebServerMiddleware {
GDCLASS(CSRFTokenWebServerMiddleware, WebServerMiddleware);
public:
//returnring true means handled, false means continue
bool _on_before_handle_request_main(Ref<WebServerRequest> request);
bool shold_ignore(Ref<WebServerRequest> request);
virtual String create_token();
2022-06-26 15:00:25 +02:00
CSRFTokenWebServerMiddleware();
~CSRFTokenWebServerMiddleware();
Vector<String> ignored_urls;
protected:
static void _bind_methods();
};
2022-06-26 15:00:25 +02:00
#endif