summaryrefslogtreecommitdiff
path: root/subprojects/battleNetApi/include/token.hpp
diff options
context:
space:
mode:
authorAotrix <[email protected]>2025-11-02 13:35:17 +0100
committerAotrix <[email protected]>2025-11-02 13:35:17 +0100
commit5fef66994abbc501025328582c02708bddccea77 (patch)
tree7b28b787b4db50f87c3a6590641e19e10fe91377 /subprojects/battleNetApi/include/token.hpp
parenta3b225f2b08172ab3639a4614033396dcae5d764 (diff)
refacto... but there is a segfault
Diffstat (limited to 'subprojects/battleNetApi/include/token.hpp')
-rw-r--r--subprojects/battleNetApi/include/token.hpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/subprojects/battleNetApi/include/token.hpp b/subprojects/battleNetApi/include/token.hpp
index 0b66f53..e1544e8 100644
--- a/subprojects/battleNetApi/include/token.hpp
+++ b/subprojects/battleNetApi/include/token.hpp
@@ -3,18 +3,20 @@
class Token {
public:
- Token(const std::string &iTokenFilePath);
+ Token(const std::string &iTokenFilePath, const std::string &iUsername, const std::string &iPassword);
std::string toString() const;
private:
const std::string mFilePath; //!< Path to the token file
const std::string mToken; //!< Token value
+ const std::string mUsername; //!< Username for Battle.net API
+ const std::string mPassword; //!< Password for Battle.net API
std::string getValidToken() const;
void refreshToken() const;
void writeNewTokenToFile() const;
void writeTokenToFile(const std::string &iToken) const;
- std::string getValidTokenWithApi(const std::string &iUser, const std::string &iPassword) const;
+ std::string getValidTokenWithApi() const;
std::chrono::seconds getCurrentTime() const;
std::string extractFirstMatchRegex(const std::string &t_str, const std::string &t_regex) const;
static size_t curlCallbackStringOutput(void *t_contents, size_t t_size, size_t t_nmemb, std::string *t_s);