updated and added namespaces
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

This commit is contained in:
wt committed 2025-04-18 16:43:57 +07:00
1 parent 886f0aed59
commit a06da5a6d4
18 files changed
+698 -641

No files matched your search

+18 -13
View File
@@ -3,19 +3,24 @@
#include <includes.hpp>
#include <jwt.hpp>
#include <syslog.h>
// function for verify tokens
bool verify_auth(const std::string& token)
namespace AuthService
{
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;
namespace Auth
{
// 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;
}
}
}
}