diff --git a/launcher/ui/dialogs/MSALoginDialog.cpp b/launcher/ui/dialogs/MSALoginDialog.cpp index 74fff9fd3..5dba84858 100644 --- a/launcher/ui/dialogs/MSALoginDialog.cpp +++ b/launcher/ui/dialogs/MSALoginDialog.cpp @@ -105,8 +105,17 @@ void MSALoginDialog::showVerificationUriAndCode(const QUrl& uri, const QString& QString urlString = uri.toString(); QString linkString = QString("%2").arg(urlString, urlString); - ui->label->setText( - tr("
Please open up %1 in a browser and put in the code %2 to proceed with login.
").arg(linkString, code)); + if (urlString == "https://www.microsoft.com/link" && !code.isEmpty()) { + urlString += QString("?otc=%1").arg(code); + DesktopServices::openUrl(urlString); + ui->label->setText( + tr("Please login in the opened browser. If no browser was opened please follow the following instructions:
" + "Please open up %1 in a browser and put in the code %2 to proceed with login.
") + .arg(linkString, code)); + } else { + ui->label->setText( + tr("Please open up %1 in a browser and put in the code %2 to proceed with login.
").arg(linkString, code)); + } ui->actionButton->setVisible(true); connect(ui->actionButton, &QPushButton::clicked, [=]() { DesktopServices::openUrl(uri);