7 #include <Cutelyst/Context>
8 #include <Cutelyst/ParamsMultiMap>
9 #include <Cutelyst/Request>
10 #include <Cutelyst/Response>
11 #include <grantlee/exception.h>
12 #include <grantlee/parser.h>
14 #ifdef PLUGIN_CSRFPROTECTION_ENABLED
15 # include <Cutelyst/Plugins/CSRFProtection/CSRFProtection>
18 Grantlee::Node *CSRFTag::getNode(
const QString &tagContent, Grantlee::Parser *p)
const
24 CSRF::CSRF(Grantlee::Parser *parser)
25 : Grantlee::Node(parser)
29 void CSRF::render(Grantlee::OutputStream *stream, Grantlee::Context *gc)
const
31 #ifdef PLUGIN_CSRFPROTECTION_ENABLED
35 const QVariantHash hash = gc->stackHash(0);
36 auto it = hash.constBegin();
37 while (it != hash.constEnd()) {
38 if (it.value().userType() == qMetaTypeId<Cutelyst::Context *>()) {
41 m_cutelystContext = it.key();
57 qWarning(
"%s",
"The CSRF protection plugin has not been built.");
61 #include "moc_csrf.cpp"
static QString getTokenFormField(Context *c)