mirror of
https://github.com/DarkflameUniverse/DarkflameServer.git
synced 2026-02-26 12:49:48 +00:00
WIP
This commit is contained in:
@@ -5,6 +5,7 @@
|
||||
#include <memory>
|
||||
#include <algorithm>
|
||||
#include "eHTTPStatusCode.h"
|
||||
#include "json.hpp"
|
||||
|
||||
/**
|
||||
* HTTP Request Context
|
||||
@@ -56,4 +57,14 @@ struct HTTPContext {
|
||||
std::transform(lowerName.begin(), lowerName.end(), lowerName.begin(), ::tolower);
|
||||
headers[lowerName] = value;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get user data as JSON for template rendering
|
||||
*/
|
||||
nlohmann::json GetUserDataJson() const {
|
||||
nlohmann::json userData;
|
||||
userData["username"] = authenticatedUser;
|
||||
userData["gmLevel"] = gmLevel;
|
||||
return userData;
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user