aboutsummaryrefslogtreecommitdiff
path: root/launcher
diff options
context:
space:
mode:
authortimoreo <contact@timoreo.fr>2022-08-10 18:14:26 +0200
committerGitHub <noreply@github.com>2022-08-10 18:14:26 +0200
commita5da3db9662a94b601bb203ce75084be522cfa91 (patch)
tree4e700a374156f05d086a6e9fc2122a96075a5bff /launcher
parent75f92de8f8517142289dc76d071cfb4fa724598c (diff)
parent355762aa303361819340cc2f8b92ada326a7e03d (diff)
downloadPrismLauncher-a5da3db9662a94b601bb203ce75084be522cfa91.tar.gz
PrismLauncher-a5da3db9662a94b601bb203ce75084be522cfa91.tar.bz2
PrismLauncher-a5da3db9662a94b601bb203ce75084be522cfa91.zip
Merge pull request #1018 from Scrumplex/fix-infinite-auth-loop
Diffstat (limited to 'launcher')
-rw-r--r--launcher/Application.cpp3
-rw-r--r--launcher/LaunchController.cpp20
2 files changed, 18 insertions, 5 deletions
diff --git a/launcher/Application.cpp b/launcher/Application.cpp
index 97d41993..9268a8ae 100644
--- a/launcher/Application.cpp
+++ b/launcher/Application.cpp
@@ -1258,6 +1258,9 @@ bool Application::launch(
}
connect(controller.get(), &LaunchController::succeeded, this, &Application::controllerSucceeded);
connect(controller.get(), &LaunchController::failed, this, &Application::controllerFailed);
+ connect(controller.get(), &LaunchController::aborted, this, [this] {
+ controllerFailed(tr("Aborted"));
+ });
addRunningInstance();
controller->start();
return true;
diff --git a/launcher/LaunchController.cpp b/launcher/LaunchController.cpp
index d36ee3fe..11f9b2bb 100644
--- a/launcher/LaunchController.cpp
+++ b/launcher/LaunchController.cpp
@@ -145,16 +145,26 @@ void LaunchController::login() {
return;
}
- // we try empty password first :)
- QString password;
// we loop until the user succeeds in logging in or gives up
bool tryagain = true;
- // the failure. the default failure.
- const QString needLoginAgain = tr("Your account is currently not logged in. Please enter your password to log in again. <br /> <br /> This could be caused by a password change.");
- QString failReason = needLoginAgain;
+ unsigned int tries = 0;
while (tryagain)
{
+ if (tries > 0 && tries % 3 == 0) {
+ auto result = QMessageBox::question(
+ m_parentWidget,
+ tr("Continue launch?"),
+ tr("It looks like we couldn't launch after %1 tries. Do you want to continue trying?")
+ .arg(tries)
+ );
+
+ if (result == QMessageBox::No) {
+ emitAborted();
+ return;
+ }
+ }
+ tries++;
m_session = std::make_shared<AuthSession>();
m_session->wants_online = m_online;
m_accountToUse->fillSession(m_session);