summary refs log tree commit diff
path: root/src/RegisterPage.cpp
diff options
context:
space:
mode:
authorJoseph Donofry <joedonofry@gmail.com>2021-08-16 17:16:17 -0400
committerJoseph Donofry <joedonofry@gmail.com>2021-08-16 17:16:17 -0400
commit093f9f9e338f7898a2e3e3ed5673952639015cab (patch)
tree4117da7ddaf1bb2c2e3dbd8b51277343142f799c /src/RegisterPage.cpp
parentMerge origin/master and fix conflicts (diff)
parentUpdate qt5 path in macos deploy.sh script (diff)
downloadnheko-093f9f9e338f7898a2e3e3ed5673952639015cab.tar.xz
Merge remote-tracking branch 'nheko-im/master' into video_player_enhancements
Diffstat (limited to 'src/RegisterPage.cpp')
-rw-r--r--src/RegisterPage.cpp18
1 files changed, 18 insertions, 0 deletions
diff --git a/src/RegisterPage.cpp b/src/RegisterPage.cpp

index bae24df0..fb6a1b97 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> @@ -481,6 +482,23 @@ RegisterPage::doUIA(const mtx::user_interactive::Unauthorized &unauthorized) doRegistrationWithAuth( mtx::user_interactive::Auth{session, mtx::user_interactive::auth::Dummy{}}); + } else if (current_stage == mtx::user_interactive::auth_types::registration_token) { + bool ok; + QString token = + QInputDialog::getText(this, + tr("Registration token"), + tr("Please enter a valid registration token."), + QLineEdit::Normal, + QString(), + &ok); + + if (ok) { + emit registrationWithAuth(mtx::user_interactive::Auth{ + session, + mtx::user_interactive::auth::RegistrationToken{token.toStdString()}}); + } else { + emit errorOccurred(); + } } else { // use fallback auto dialog = new dialogs::FallbackAuth(