summary refs log tree commit diff
path: root/src/RegisterPage.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/RegisterPage.cpp')
-rw-r--r--src/RegisterPage.cpp22
1 files changed, 5 insertions, 17 deletions
diff --git a/src/RegisterPage.cpp b/src/RegisterPage.cpp

index 1eac85fd..acee6f78 100644 --- a/src/RegisterPage.cpp +++ b/src/RegisterPage.cpp
@@ -3,6 +3,7 @@ // // SPDX-License-Identifier: GPL-3.0-or-later +#include <QInputDialog> #include <QLabel> #include <QMetaType> #include <QPainter> @@ -25,7 +26,6 @@ #include "dialogs/FallbackAuth.h" #include "dialogs/ReCaptcha.h" -#include "dialogs/TokenRegistration.h" Q_DECLARE_METATYPE(mtx::user_interactive::Unauthorized) Q_DECLARE_METATYPE(mtx::user_interactive::Auth) @@ -483,22 +483,10 @@ RegisterPage::doUIA(const mtx::user_interactive::Unauthorized &unauthorized) mtx::user_interactive::Auth{session, mtx::user_interactive::auth::Dummy{}}); } else if (current_stage == mtx::user_interactive::auth_types::registration_token) { - auto dialog = new dialogs::TokenRegistration(this); - - connect(dialog, - &dialogs::TokenRegistration::confirmation, - this, - [this, session, dialog](std::string token) { - dialog->close(); - dialog->deleteLater(); - emit registrationWithAuth(mtx::user_interactive::Auth{ - session, mtx::user_interactive::auth::RegistrationToken{token}}); - }); - - connect( - dialog, &dialogs::TokenRegistration::cancel, this, &RegisterPage::errorOccurred); - - dialog->show(); + QString token = QInputDialog::getText( + this, tr("Registration token"), tr("Please enter a valid registration token.")); + emit registrationWithAuth(mtx::user_interactive::Auth{ + session, mtx::user_interactive::auth::RegistrationToken{token.toStdString()}}); } else { // use fallback auto dialog = new dialogs::FallbackAuth(