20 #include <grantlee/exception.h> 21 #include <grantlee/parser.h> 23 #include <Cutelyst/Context> 24 #include <Cutelyst/ParamsMultiMap> 25 #include <Cutelyst/Request> 26 #include <Cutelyst/Response> 28 #ifdef PLUGIN_CSRFPROTECTION_ENABLED 29 #include <Cutelyst/Plugins/CSRFProtection/CSRFProtection> 32 Grantlee::Node *CSRFTag::getNode(
const QString &tagContent, Grantlee::Parser *p)
const 38 CSRF::CSRF(Grantlee::Parser *parser) :
Grantlee::Node(parser)
42 void CSRF::render(Grantlee::OutputStream *stream, Grantlee::Context *gc)
const 44 #ifdef PLUGIN_CSRFPROTECTION_ENABLED 48 const QVariantHash hash = gc->stackHash(0);
49 auto it = hash.constBegin();
50 while (it != hash.constEnd()) {
51 if (it.value().userType() == qMetaTypeId<Cutelyst::Context *>()) {
54 m_cutelystContext = it.key();
70 qWarning(
"%s",
"The CSRF protection plugin has not been built.");
74 #include "moc_csrf.cpp"
static QString getTokenFormField(Context *c)