summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorCallum Brown <callum@calcuode.com>2021-08-12 17:57:07 +0100
committerCallum Brown <callum@calcuode.com>2021-08-12 17:57:07 +0100
commit4fa644f2b7d0e95f8f917dc6d4d030153c0da73e (patch)
tree726d5bf8c0eb16da0050cecf789bb6285c0c0a18 /src
parentUse QInputDialog to get registration token (diff)
downloadnheko-4fa644f2b7d0e95f8f917dc6d4d030153c0da73e.tar.xz
Fix cancel button on registration token dialog
Diffstat (limited to 'src')
-rw-r--r--src/RegisterPage.cpp19
1 files changed, 15 insertions, 4 deletions
diff --git a/src/RegisterPage.cpp b/src/RegisterPage.cpp

index acee6f78..ddd4d47d 100644 --- a/src/RegisterPage.cpp +++ b/src/RegisterPage.cpp
@@ -483,10 +483,21 @@ 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) { - 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()}}); + 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(