mirror of
https://github.com/yuzu-emu/yuzu-android.git
synced 2025-06-13 13:38:08 -05:00
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
This commit is contained in:
@ -15,6 +15,7 @@
|
||||
|
||||
#ifdef ENABLE_WEB_SERVICE
|
||||
#include "web_service/telemetry_json.h"
|
||||
#include "web_service/verify_login.h"
|
||||
#endif
|
||||
|
||||
namespace Core {
|
||||
@ -75,6 +76,17 @@ u64 RegenerateTelemetryId() {
|
||||
return new_telemetry_id;
|
||||
}
|
||||
|
||||
std::future<bool> VerifyLogin(std::string username, std::string token, std::function<void()> func) {
|
||||
#ifdef ENABLE_WEB_SERVICE
|
||||
return WebService::VerifyLogin(username, token, Settings::values.verify_endpoint_url, func);
|
||||
#else
|
||||
return std::async(std::launch::async, [func{std::move(func)}]() {
|
||||
func();
|
||||
return false;
|
||||
});
|
||||
#endif
|
||||
}
|
||||
|
||||
TelemetrySession::TelemetrySession() {
|
||||
#ifdef ENABLE_WEB_SERVICE
|
||||
if (Settings::values.enable_telemetry) {
|
||||
|
Reference in New Issue
Block a user