diff options
Diffstat (limited to 'src/web_service/web_backend.cpp')
| -rw-r--r-- | src/web_service/web_backend.cpp | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/src/web_service/web_backend.cpp b/src/web_service/web_backend.cpp index b7737b615..dc149d2ed 100644 --- a/src/web_service/web_backend.cpp +++ b/src/web_service/web_backend.cpp | |||
| @@ -10,7 +10,6 @@ | |||
| 10 | #include "common/common_types.h" | 10 | #include "common/common_types.h" |
| 11 | #include "common/logging/log.h" | 11 | #include "common/logging/log.h" |
| 12 | #include "common/web_result.h" | 12 | #include "common/web_result.h" |
| 13 | #include "core/settings.h" | ||
| 14 | #include "web_service/web_backend.h" | 13 | #include "web_service/web_backend.h" |
| 15 | 14 | ||
| 16 | namespace WebService { | 15 | namespace WebService { |
| @@ -25,7 +24,7 @@ constexpr u32 TIMEOUT_SECONDS = 30; | |||
| 25 | struct Client::Impl { | 24 | struct Client::Impl { |
| 26 | Impl(std::string host, std::string username, std::string token) | 25 | Impl(std::string host, std::string username, std::string token) |
| 27 | : host{std::move(host)}, username{std::move(username)}, token{std::move(token)} { | 26 | : host{std::move(host)}, username{std::move(username)}, token{std::move(token)} { |
| 28 | std::lock_guard<std::mutex> lock(jwt_cache.mutex); | 27 | std::lock_guard lock{jwt_cache.mutex}; |
| 29 | if (this->username == jwt_cache.username && this->token == jwt_cache.token) { | 28 | if (this->username == jwt_cache.username && this->token == jwt_cache.token) { |
| 30 | jwt = jwt_cache.jwt; | 29 | jwt = jwt_cache.jwt; |
| 31 | } | 30 | } |
| @@ -152,7 +151,7 @@ struct Client::Impl { | |||
| 152 | if (result.result_code != Common::WebResult::Code::Success) { | 151 | if (result.result_code != Common::WebResult::Code::Success) { |
| 153 | LOG_ERROR(WebService, "UpdateJWT failed"); | 152 | LOG_ERROR(WebService, "UpdateJWT failed"); |
| 154 | } else { | 153 | } else { |
| 155 | std::lock_guard<std::mutex> lock(jwt_cache.mutex); | 154 | std::lock_guard lock{jwt_cache.mutex}; |
| 156 | jwt_cache.username = username; | 155 | jwt_cache.username = username; |
| 157 | jwt_cache.token = token; | 156 | jwt_cache.token = token; |
| 158 | jwt_cache.jwt = jwt = result.returned_data; | 157 | jwt_cache.jwt = jwt = result.returned_data; |