mirror of
https://github.com/celisej567/abaddon.git
synced 2026-09-19 20:11:59 +03:00
show status, error when captcha required
This commit is contained in:
@@ -1206,6 +1206,13 @@ void DiscordClient::RemoteAuthLogin(const std::string &ticket, const sigc::slot<
|
||||
if (CheckCode(r)) {
|
||||
callback(nlohmann::json::parse(r.text).at("encrypted_token").get<std::string>(), DiscordError::NONE);
|
||||
} else {
|
||||
try {
|
||||
const auto j = nlohmann::json::parse(r.text);
|
||||
if (j.contains("captcha_service")) {
|
||||
callback(std::nullopt, DiscordError::CAPTCHA_REQUIRED);
|
||||
return;
|
||||
}
|
||||
} catch (...) {}
|
||||
callback(std::nullopt, GetCodeFromResponse(r));
|
||||
}
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user