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.
This commit is contained in:
jp9000 2019-12-05 00:52:39 -08:00
parent cfddf1112b
commit ccb7d897c6
2 changed files with 4 additions and 0 deletions

View file

@ -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();

View file

@ -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();