UI: Fix Mixer allowing endless login retries

This commit is contained in:
jp9000 2019-02-26 07:24:22 -08:00
parent 1c4a6ca6c6
commit ca6561758c
2 changed files with 5 additions and 5 deletions

View File

@ -44,7 +44,7 @@ MixerAuth::MixerAuth(const Def &d)
{
}
bool MixerAuth::GetChannelInfo()
bool MixerAuth::GetChannelInfo(bool allow_retry)
try {
std::string client_id = MIXER_CLIENTID;
deobfuscate_str(&client_id[0], MIXER_HASH);
@ -148,8 +148,8 @@ try {
* it'll be an empty stream key usually. So treat empty stream key as
* an error. */
if (key_suffix.empty()) {
if (RetryLogin()) {
return GetChannelInfo();
if (allow_retry && RetryLogin()) {
return GetChannelInfo(false);
}
throw ErrorInfo("Auth Failure", "Could not get channel data");
}
@ -305,7 +305,7 @@ std::shared_ptr<Auth> MixerAuth::Login(QWidget *parent)
}
std::string error;
if (auth->GetChannelInfo()) {
if (auth->GetChannelInfo(false)) {
return auth;
}

View File

@ -19,7 +19,7 @@ class MixerAuth : public OAuthStreamKey {
virtual void SaveInternal() override;
virtual bool LoadInternal() override;
bool GetChannelInfo();
bool GetChannelInfo(bool allow_retry = true);
virtual void LoadUI() override;