mirror of
https://github.com/Nheko-Reborn/nheko.git
synced 2024-11-26 13:08:48 +03:00
Merge pull request #680 from govynnus/token-registration
Support token authenticated registration
This commit is contained in:
commit
b1634d60a0
1 changed files with 18 additions and 0 deletions
|
@ -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(
|
||||
|
|
Loading…
Reference in a new issue