fixing error is nholmann traits

This commit is contained in:
Christopher McArthur
2020-05-20 14:36:50 -04:00
parent b3de79da98
commit f45db90c43
2 changed files with 4 additions and 3 deletions

View File

@@ -7,7 +7,8 @@ set(TEST_SOURCES
${CMAKE_CURRENT_SOURCE_DIR}/HelperTest.cpp
${CMAKE_CURRENT_SOURCE_DIR}/TestMain.cpp
${CMAKE_CURRENT_SOURCE_DIR}/TokenFormatTest.cpp
${CMAKE_CURRENT_SOURCE_DIR}/TokenTest.cpp)
${CMAKE_CURRENT_SOURCE_DIR}/TokenTest.cpp
${CMAKE_CURRENT_SOURCE_DIR}/NlohmannTest.cpp)
add_executable(jwt-cpp-test ${TEST_SOURCES})
target_compile_options(jwt-cpp-test PRIVATE

View File

@@ -26,10 +26,10 @@ struct nlohmann_traits {
throw std::logic_error("invalid type");
}
static json::value_t as_object(const json &val) {
static json::object_t as_object(const json &val) {
if (val.type() != json::value_t::object)
throw std::bad_cast();
return val.get<json::value_t>();
return val.get<json::object_t>();
}
static std::string as_string(const json &val) {