0rangefox / drogon-jwt-filter-example Goto Github PK
View Code? Open in Web Editor NEWA simple project to serve as an example of how to implement an JWT filter on Drogon framework.
License: MIT License
A simple project to serve as an example of how to implement an JWT filter on Drogon framework.
License: MIT License
Hello!
I'm trying to get json from a request in the filter for further analysis of this data by the filter. But I get a null pointer
Is there any way to get json from a request in a filter? Thanks for the answers!
void InSomnia::Filter::Login::doFilter(
const drogon::HttpRequestPtr &req,
drogon::FilterCallback &&fcb,
drogon::FilterChainCallback &&fccb)
{
const std::shared_ptr < Json::Value > jsonPtr = req->jsonObject();
if(!jsonPtr)
{
// Gets here
}
}
Full log:
-- The C compiler identification is GNU 11.2.0
-- The CXX compiler identification is GNU 11.2.0
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: C:/Users/A/AppData/Local/JetBrains/Toolbox/apps/CLion/ch-0/222.4167.35/bin/mingw/bin/gcc.exe - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: C:/Users/A/AppData/Local/JetBrains/Toolbox/apps/CLion/ch-0/222.4167.35/bin/mingw/bin/g++.exe - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Looking for C++ include any
-- Looking for C++ include any - found
-- Looking for C++ include string_view
-- Looking for C++ include string_view - found
-- Looking for C++ include coroutine
-- Looking for C++ include coroutine - not found
-- compiler: GNU
-- Performing Test COMPILER_HAS_DEPRECATED_ATTR
-- Performing Test COMPILER_HAS_DEPRECATED_ATTR - Success
-- Found OpenSSL: C:/Program Files/PostgreSQL/14/lib/libcrypto.lib (found version "1.1.1q")
-- Could NOT find c-ares (missing: C-ARES_INCLUDE_DIRS C-ARES_LIBRARIES)
-- Looking for pthread.h
-- Looking for pthread.h - found
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Success
-- Found Threads: TRUE
-- Could NOT find Doxygen (missing: DOXYGEN_EXECUTABLE)
-- Looking for C++ include filesystem
-- Looking for C++ include filesystem - found
-- Performing Test CXX_FILESYSTEM_NO_LINK_NEEDED
-- Performing Test CXX_FILESYSTEM_NO_LINK_NEEDED - Success
-- Found std::filesystem
-- use c++17
CMake Error at C:/Users/A/AppData/Local/JetBrains/Toolbox/apps/CLion/ch-0/222.4167.35/bin/cmake/win/share/cmake-3.23/Modules/FindPackageHandleStandardArgs.cmake:230 (message):
Could NOT find Jsoncpp (missing: JSONCPP_INCLUDE_DIRS JSONCPP_LIBRARIES)
Call Stack (most recent call first):
C:/Users/A/AppData/Local/JetBrains/Toolbox/apps/CLion/ch-0/222.4167.35/bin/cmake/win/share/cmake-3.23/Modules/FindPackageHandleStandardArgs.cmake:594 (_FPHSA_FAILURE_MESSAGE)
libraries/drogon/cmake_modules/FindJsoncpp.cmake:36 (find_package_handle_standard_args)
libraries/drogon/CMakeLists.txt:202 (find_package)
Hi,
In this line:
Will happen a crash if the header has length < 7
.
Thanks.
Does not even compile:
error: ‘picojson_traits’ is not a member of ‘jwt’
The dependencies of this project have updated.Jwt-cpp have some Breaking Changes.Drogon and picojson and so on have updated too.Could you please update a new version that can use the new version of the dependencies,thank you very much.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.