Removed couts

This commit is contained in:
zv0n 2022-02-26 11:35:20 +01:00
parent 133f28e155
commit 15047bd623
5 changed files with 0 additions and 32 deletions

View File

@ -52,7 +52,6 @@ bool verifyJWT(const std::string &token) {
}
result = true;
std::cout << "USER " << jwt_get_grant(jwt, "user") << " LOGGED IN!" << std::endl;
finished_valid:
finish:

View File

@ -31,7 +31,6 @@ void performPostFunc(const std::shared_ptr<restbed::Session> &session, const std
session->fetch( content_length, [callback]( const std::shared_ptr< restbed::Session > &session, const restbed::Bytes & body )
{
rapidjson::Document doc;
std::cout << std::string(reinterpret_cast<const char*>(body.data()), body.size()) << std::endl;
doc.Parse(reinterpret_cast<const char*>(body.data()), body.size());
if(doc.HasParseError()) {
sendResponse("ERROR: Invalid body!", 401, session);
@ -42,12 +41,10 @@ void performPostFunc(const std::shared_ptr<restbed::Session> &session, const std
}
bool verifyLogin( const std::shared_ptr< restbed::Session > &session, rapidjson::GenericDocument<rapidjson::UTF8<>> &doc ) {
std::cout << "WAAA" << std::endl;
if(doc.FindMember("token") == doc.MemberEnd() || !doc["token"].IsString()) {
sendResponse("ERROR: Invalid token!", 401, session);
return false;
}
std::cout << "AAAA" << std::endl;
const auto *token = doc["token"].GetString();
auto res = verifyJWT(token);
if(!res) {
@ -78,7 +75,6 @@ std::string getTypesJson() {
}
result << " ]\n}";
auto res = result.str();
std::cout << res << std::endl;
return res;
}
@ -112,7 +108,6 @@ std::string getOptionsJson(const RenameObject &search) {
}
res << " ]\n}";
auto result = res.str();
std::cout << result << std::endl;
return result;
}
@ -235,7 +230,6 @@ void renamePathRest( const std::shared_ptr< restbed::Session > &session, rapidjs
}
std::string getFilesJson() {
std::cout << "GETTING FILES JSON" << std::endl;
std::ostringstream res;
res << "{\n \"files\": [\n";
auto files = getFilesInSource(cfg.getSourcePath());
@ -326,7 +320,6 @@ std::pair<bool, std::string> move(std::string path, uint64_t target_id, const st
path = cfg.getSourcePath() + "/" + path;
}
auto canon_path = FSLib::canonical(path);
std::cout << "CANON: " << canon_path << std::endl;
if(canon_path.substr(0, cfg.getSourcePath().length()) != cfg.getSourcePath()) {
return {false, "Invalid path"};
}

View File

@ -11,10 +11,6 @@
#include <codecvt>
#include <shlobj.h>
#define cout std::wcout
#define cerr std::wcerr
#define cin std::wcin
constexpr const char_t *dir_divider = L"\\";
#else // UNIX
@ -24,10 +20,6 @@ constexpr const char_t *dir_divider = L"\\";
#include <sys/ioctl.h>
#include <unistd.h>
#define cout std::cout
#define cerr std::cerr
#define cin std::cin
constexpr const char_t *dir_divider = "/";
#endif // UNIX

View File

@ -12,10 +12,6 @@
#include <codecvt>
#include <shlobj.h>
#define cout std::wcout
#define cerr std::wcerr
#define cin std::wcin
constexpr const char_t *dir_divider = L"\\";
#else // UNIX
@ -25,10 +21,6 @@ constexpr const char_t *dir_divider = L"\\";
#include <sys/ioctl.h>
#include <unistd.h>
#define cout std::cout
#define cerr std::cerr
#define cin std::cin
constexpr const char_t *dir_divider = "/";
#endif // UNIX

View File

@ -30,20 +30,12 @@
constexpr const char_t *_tv_rename_dir_divider = L"\\";
#define cout std::wcout
#define cerr std::wcerr
#define cin std::wcin
#define toString( a ) utf8_to_wstring( a )
#else
constexpr const char_t *_tv_rename_dir_divider = "/";
#define cout std::cout
#define cerr std::cerr
#define cin std::cin
#define toString( a ) a
#endif