restart remote auth on cancel opcode

This commit is contained in:
ouwou committed 2023-07-09 21:49:15 -04:00
1 parent 3c2fde661e
commit 2ca5a21ab4
2 files changed
+8

No files matched your search

+7
View File
@@ -58,6 +58,8 @@ void RemoteAuthClient::OnGatewayMessage(const std::string &str) {
HandleGatewayPendingTicket(j);
} else if (opcode == "pending_login") {
HandleGatewayPendingLogin(j);
} else if (opcode == "cancel") {
HandleGatewayCancel(j);
}
}
@@ -125,6 +127,11 @@ void RemoteAuthClient::HandleGatewayPendingLogin(const nlohmann::json &j) {
m_signal_pending_login.emit();
}
void RemoteAuthClient::HandleGatewayCancel(const nlohmann::json &j) {
Stop();
Start();
}
void RemoteAuthClient::OnRemoteAuthLoginResponse(const std::optional<std::string> &encrypted_token, DiscordError err) {
if (!encrypted_token.has_value()) {
m_log->error("Remote auth login failed: {}", static_cast<int>(err));
+1
View File
@@ -23,6 +23,7 @@ private:
void HandleGatewayPendingRemoteInit(const nlohmann::json &j);
void HandleGatewayPendingTicket(const nlohmann::json &j);
void HandleGatewayPendingLogin(const nlohmann::json &j);
void HandleGatewayCancel(const nlohmann::json &j);
void OnRemoteAuthLoginResponse(const std::optional<std::string> &encrypted_token, DiscordError err);