Validate that user id matches token

This commit is contained in:
WarmUpTill
2026-03-17 20:36:53 +01:00
committed by WarmUpTill
parent bf216e0917
commit bf18d8e106
8 changed files with 147 additions and 52 deletions

View File

@@ -51,7 +51,7 @@ public:
void SetToken(const std::string &);
bool IsEmpty() const { return _token.empty(); }
std::optional<std::string> GetToken() const;
std::string GetUserID() const { return _userID; }
std::optional<std::string> GetUserID() const { return _userID; }
std::shared_ptr<EventSub> GetEventSub();
bool ValidateTimestamps() const { return _validateEventSubTimestamps; }
bool IsValid(bool forceUpdate = false) const;
@@ -65,7 +65,7 @@ private:
mutable std::string _lastValidityCheckValue;
mutable bool _lastValidityCheckResult = false;
mutable std::chrono::system_clock::time_point _lastValidityCheckTime;
std::string _userID;
std::optional<std::string> _userID;
std::set<TokenOption> _tokenOptions = TokenOption::GetAllTokenOptions();
std::shared_ptr<EventSub> _eventSub;
bool _validateEventSubTimestamps = false;