From 0634d3f09c6e427e0b5091ebd9ba770099057951 Mon Sep 17 00:00:00 2001 From: Loren Burkholder Date: Thu, 13 Jul 2023 12:53:51 -0400 Subject: QML the fallback auth dialog --- src/FallbackAuth.cpp | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 src/FallbackAuth.cpp (limited to 'src/FallbackAuth.cpp') diff --git a/src/FallbackAuth.cpp b/src/FallbackAuth.cpp new file mode 100644 index 00000000..5b668310 --- /dev/null +++ b/src/FallbackAuth.cpp @@ -0,0 +1,29 @@ +// SPDX-FileCopyrightText: Nheko Contributors +// +// SPDX-License-Identifier: GPL-3.0-or-later + +#include "FallbackAuth.h" + +#include +#include + +#include "MatrixClient.h" + +FallbackAuth::FallbackAuth(const QString &session, const QString &authType, QObject *parent) + : QObject{parent} + , m_session{session} + , m_authType{authType} +{ +} + +void +FallbackAuth::openFallbackAuth() +{ + const auto url = QString("https://%1:%2/_matrix/client/r0/auth/%4/" + "fallback/web?session=%3") + .arg(QString::fromStdString(http::client()->server())) + .arg(http::client()->port()) + .arg(m_session, m_authType); + + QDesktopServices::openUrl(url); +} -- cgit 1.5.1