mirror of
https://github.com/DarkflameUniverse/DarkflameServer.git
synced 2026-07-01 11:04:20 +00:00
WIP
This commit is contained in:
@@ -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>());
|
||||
|
||||
|
||||
Reference in New Issue
Block a user