From ccb7d897c6f257ab6821c4f82621206538c3ff51 Mon Sep 17 00:00:00 2001 From: jp9000 Date: Thu, 5 Dec 2019 00:52:39 -0800 Subject: [PATCH] UI: Delete cookies before connecting account Fixes an issue where when trying to connect a Twitch account, and the Twitch two-factor authentication check fails, the user will still technically be logged in because the cookies will still be present, thus when they try to click the "Connect" button again, it will skip the login part (because they're already technically logged in), and just give them the two-factor failure message without letting them enter in their login information again. --- UI/window-basic-auto-config.cpp | 2 ++ UI/window-basic-settings-stream.cpp | 2 ++ 2 files changed, 4 insertions(+) diff --git a/UI/window-basic-auto-config.cpp b/UI/window-basic-auto-config.cpp index a72768c43..02eff198e 100644 --- a/UI/window-basic-auto-config.cpp +++ b/UI/window-basic-auto-config.cpp @@ -417,6 +417,8 @@ void AutoConfigStreamPage::on_connectAccount_clicked() #ifdef BROWSER_AVAILABLE std::string service = QT_TO_UTF8(ui->service->currentText()); + OAuth::DeleteCookies(service); + auth = OAuthStreamKey::Login(this, service); if (!!auth) OnAuthConnected(); diff --git a/UI/window-basic-settings-stream.cpp b/UI/window-basic-settings-stream.cpp index ecb7f101b..3c741196e 100644 --- a/UI/window-basic-settings-stream.cpp +++ b/UI/window-basic-settings-stream.cpp @@ -492,6 +492,8 @@ void OBSBasicSettings::on_connectAccount_clicked() #ifdef BROWSER_AVAILABLE std::string service = QT_TO_UTF8(ui->service->currentText()); + OAuth::DeleteCookies(service); + auth = OAuthStreamKey::Login(this, service); if (!!auth) OnAuthConnected();