7 #include <Cutelyst/Context> 8 #include <Cutelyst/ParamsMultiMap> 9 #include <Cutelyst/Request> 10 #include <Cutelyst/Response> 11 #include <cutelee/exception.h> 12 #include <cutelee/parser.h> 14 #ifdef PLUGIN_CSRFPROTECTION_ENABLED 15 # include <Cutelyst/Plugins/CSRFProtection/CSRFProtection> 18 Cutelee::Node *CSRFTag::getNode(
const QString &tagContent, Cutelee::Parser *p)
const 24 CSRF::CSRF(Cutelee::Parser *parser)
29 void CSRF::render(Cutelee::OutputStream *stream, Cutelee::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();
53 *stream << Cutelyst::CSRFProtection::getTokenFormField(c);
57 qWarning(
"%s",
"The CSRF protection plugin has not been built.");
61 Cutelee::Node *CSRFTokenTag::getNode(
const QString &tagContent, Cutelee::Parser *p)
const 64 return new CSRFToken(p);
67 CSRFToken::CSRFToken(Cutelee::Parser *parser)
72 void CSRFToken::render(Cutelee::OutputStream *stream, Cutelee::Context *gc)
const 74 #ifdef PLUGIN_CSRFPROTECTION_ENABLED 78 const QVariantHash hash = gc->stackHash(0);
79 auto it = hash.constBegin();
80 while (it != hash.constEnd()) {
81 if (it.value().userType() == qMetaTypeId<Cutelyst::Context *>()) {
84 m_cutelystContext = it.key();
100 qWarning(
"%s",
"The CSRF protection plugin has not been built.");
104 #include "moc_csrf.cpp"
QString fromLatin1(QByteArrayView str)