diff options
| author | 2017-09-19 03:18:26 +0200 | |
|---|---|---|
| committer | 2017-09-18 21:18:26 -0400 | |
| commit | 28c726f20545744a3052a3e8a0a3bf5ff95a5042 (patch) | |
| tree | 496b81a9d2cefbdb3ac2ed12c6525ecd72610c14 /src/core/telemetry_session.cpp | |
| parent | Merge pull request #2906 from Subv/ns_new_framework (diff) | |
| download | yuzu-28c726f20545744a3052a3e8a0a3bf5ff95a5042.tar.gz yuzu-28c726f20545744a3052a3e8a0a3bf5ff95a5042.tar.xz yuzu-28c726f20545744a3052a3e8a0a3bf5ff95a5042.zip | |
WebService: Verify username and token (#2930)
* WebService: Verify username and token; Log errors in PostJson
* Fixup: added docstrings to the functions
* Webservice: Added Icons to the verification, imrpved error detection in cpr, fixup nits
* fixup: fmt warning
Diffstat (limited to 'src/core/telemetry_session.cpp')
| -rw-r--r-- | src/core/telemetry_session.cpp | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/core/telemetry_session.cpp b/src/core/telemetry_session.cpp index 104a16cc9..ca517ff44 100644 --- a/src/core/telemetry_session.cpp +++ b/src/core/telemetry_session.cpp | |||
| @@ -15,6 +15,7 @@ | |||
| 15 | 15 | ||
| 16 | #ifdef ENABLE_WEB_SERVICE | 16 | #ifdef ENABLE_WEB_SERVICE |
| 17 | #include "web_service/telemetry_json.h" | 17 | #include "web_service/telemetry_json.h" |
| 18 | #include "web_service/verify_login.h" | ||
| 18 | #endif | 19 | #endif |
| 19 | 20 | ||
| 20 | namespace Core { | 21 | namespace Core { |
| @@ -75,6 +76,17 @@ u64 RegenerateTelemetryId() { | |||
| 75 | return new_telemetry_id; | 76 | return new_telemetry_id; |
| 76 | } | 77 | } |
| 77 | 78 | ||
| 79 | std::future<bool> VerifyLogin(std::string username, std::string token, std::function<void()> func) { | ||
| 80 | #ifdef ENABLE_WEB_SERVICE | ||
| 81 | return WebService::VerifyLogin(username, token, Settings::values.verify_endpoint_url, func); | ||
| 82 | #else | ||
| 83 | return std::async(std::launch::async, [func{std::move(func)}]() { | ||
| 84 | func(); | ||
| 85 | return false; | ||
| 86 | }); | ||
| 87 | #endif | ||
| 88 | } | ||
| 89 | |||
| 78 | TelemetrySession::TelemetrySession() { | 90 | TelemetrySession::TelemetrySession() { |
| 79 | #ifdef ENABLE_WEB_SERVICE | 91 | #ifdef ENABLE_WEB_SERVICE |
| 80 | if (Settings::values.enable_telemetry) { | 92 | if (Settings::values.enable_telemetry) { |