summaryrefslogtreecommitdiff
path: root/battleNetApi/src/token.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'battleNetApi/src/token.cpp')
-rw-r--r--battleNetApi/src/token.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/battleNetApi/src/token.cpp b/battleNetApi/src/token.cpp
index e32a946..21717cb 100644
--- a/battleNetApi/src/token.cpp
+++ b/battleNetApi/src/token.cpp
@@ -14,7 +14,7 @@ Token::Token(const std::string &iTokenFilePath) : mFilePath{iTokenFilePath}, mTo
std::string Token::text() const { return mToken; }
-const bool Token::hasTokenExpired() const {
+const bool Token::hasExpired() const {
std::ifstream aTokenFile{mFilePath};
json aCredentialsFile = json::parse(aTokenFile);
if (not aCredentialsFile.contains("Token") or not aCredentialsFile["Token"].contains("ExpirationTime") or
@@ -42,14 +42,14 @@ std::string Token::getTokenFromLocalFile() const {
}
std::string Token::generateToken() {
- if (hasTokenExpired()) {
+ if (hasExpired()) {
const std::pair<std::string, std::uint64_t> kTokenContent{getTokenWithApi()};
- writeNewTokenToLocalFile(kTokenContent);
+ writeTokenToLocalFile(kTokenContent);
}
return getTokenFromLocalFile();
}
-void Token::writeNewTokenToLocalFile(const std::pair<std::string, std::uint64_t> &iToken) const {
+void Token::writeTokenToLocalFile(const std::pair<std::string, std::uint64_t> &iToken) const {
std::ifstream aTokenFileInput{mFilePath};
json aCredentialsFile = json::parse(aTokenFileInput);
aCredentialsFile["Token"]["Content"] = iToken.first;