Files
auth_service/src/auth/verify_auth.cpp
T
wt e5abe4bb02
Prepare Build and Testing executable binary / Prepare-Build-Testing-With-Make (push) Has been cancelled
Prepare Build and Testing executable binary / Prepare-Build-Testing-With-CMake (push) Has been cancelled
Prepare Build and Testing executable binary / Prepare-Build-Testing-With-Meson (push) Has been cancelled
added editorconfig and formated code
2025-02-13 19:35:42 +07:00

22 lines
494 B
C++

#include <auth/auth.hpp>
#include <json.hpp>
#include <includes.hpp>
#include <jwt.hpp>
#include <syslog.h>
// function for verify tokens
bool verify_auth(const std::string& token)
{
try {
return JWT::verifyJWT(token, JWT_SECRET_KEY);
}
catch (const std::system_error& e) {
std::cout << "Verification error: " << e.what() << std::endl;
syslog(LOG_ERR, "token verification error");
return false;
}
catch (...) {
return false;
}
}