Skip to content
Snippets Groups Projects
Commit 4fa644f2 authored by Callum Brown's avatar Callum Brown
Browse files

Fix cancel button on registration token dialog

parent 7d484a82
No related branches found
No related tags found
No related merge requests found
Pipeline #1587 failed
......@@ -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(
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment