11 #include <oatpp/web/server/interceptor/RequestInterceptor.hpp>
12 #include <oatpp/web/protocol/http/outgoing/ResponseFactory.hpp>
13 #include <oatpp/web/protocol/http/Http.hpp>
14 #include <json/json.h>
38 std::shared_ptr<OutgoingResponse>
intercept(
39 const std::shared_ptr<IncomingRequest>& request)
override;
46 static std::shared_ptr<OutgoingResponse>
unauthorized(
const std::string& message);
DtAuthInterceptor — oatpp request interceptor that enforces session key authentication on all REST AP...
Definition: authInterceptor.h:35
std::shared_ptr< OutgoingResponse > intercept(const std::shared_ptr< IncomingRequest > &request) override
static bool requiresAuth(const std::string &path)
Returns true if the path should be checked for a valid session key.
static std::shared_ptr< OutgoingResponse > unauthorized(const std::string &message)
Builds a minimal JSON 401 response.