This commit is contained in:
Aaron Kimbrell
2026-03-26 09:56:29 -05:00
parent 8372202d8f
commit f658da19a3
27 changed files with 1669 additions and 685 deletions

View File

@@ -28,6 +28,8 @@
#include "WSRoutes.h"
#include "AuthRoutes.h"
#include "AuthMiddleware.h"
#include "DashboardAuthService.h"
#include "AuthTokenHandler.h"
namespace Game {
Logger* logger = nullptr;
@@ -130,6 +132,12 @@ int main(int argc, char** argv) {
return EXIT_FAILURE;
}
// Set up WebSocket authentication callback using consolidated handler
Game::web.SetWSAuthCallback([](const std::string& token) -> bool {
auto result = AuthTokenHandler::ValidateToken(token);
return result.isValid;
});
// Register global middleware
Game::web.AddGlobalMiddleware(std::make_shared<AuthMiddleware>());