simplify microsoft login
Signed-off-by: Trial97 <alexandru.tripon97@gmail.com>
This commit is contained in:
parent
baa988ec81
commit
8897f16d1d
@ -105,8 +105,17 @@ void MSALoginDialog::showVerificationUriAndCode(const QUrl& uri, const QString&
|
|||||||
|
|
||||||
QString urlString = uri.toString();
|
QString urlString = uri.toString();
|
||||||
QString linkString = QString("<a href=\"%1\">%2</a>").arg(urlString, urlString);
|
QString linkString = QString("<a href=\"%1\">%2</a>").arg(urlString, urlString);
|
||||||
|
if (urlString == "https://www.microsoft.com/link" && !code.isEmpty()) {
|
||||||
|
urlString += QString("?otc=%1").arg(code);
|
||||||
|
DesktopServices::openUrl(urlString);
|
||||||
|
ui->label->setText(
|
||||||
|
tr("<p>Please login in the opened browser. If no browser was opened please follow the following instructions:</p>"
|
||||||
|
"<p>Please open up %1 in a browser and put in the code <b>%2</b> to proceed with login.</p>")
|
||||||
|
.arg(linkString, code));
|
||||||
|
} else {
|
||||||
ui->label->setText(
|
ui->label->setText(
|
||||||
tr("<p>Please open up %1 in a browser and put in the code <b>%2</b> to proceed with login.</p>").arg(linkString, code));
|
tr("<p>Please open up %1 in a browser and put in the code <b>%2</b> to proceed with login.</p>").arg(linkString, code));
|
||||||
|
}
|
||||||
ui->actionButton->setVisible(true);
|
ui->actionButton->setVisible(true);
|
||||||
connect(ui->actionButton, &QPushButton::clicked, [=]() {
|
connect(ui->actionButton, &QPushButton::clicked, [=]() {
|
||||||
DesktopServices::openUrl(uri);
|
DesktopServices::openUrl(uri);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user