2021-03-05 02:35:15 +03:00
|
|
|
// SPDX-FileCopyrightText: 2021 Nheko Contributors
|
2022-01-01 06:57:53 +03:00
|
|
|
// SPDX-FileCopyrightText: 2022 Nheko Contributors
|
2021-03-05 02:35:15 +03:00
|
|
|
//
|
|
|
|
// SPDX-License-Identifier: GPL-3.0-or-later
|
|
|
|
|
2020-05-10 00:31:00 +03:00
|
|
|
#include "httplib.h"
|
|
|
|
|
|
|
|
#include <QObject>
|
|
|
|
#include <string>
|
|
|
|
|
2022-10-10 15:38:29 +03:00
|
|
|
class SSOHandler final : public QObject
|
2020-05-10 00:31:00 +03:00
|
|
|
{
|
2021-09-18 01:22:33 +03:00
|
|
|
Q_OBJECT
|
2020-05-10 00:31:00 +03:00
|
|
|
|
|
|
|
public:
|
2021-09-18 01:22:33 +03:00
|
|
|
SSOHandler(QObject *parent = nullptr);
|
2020-05-10 00:31:00 +03:00
|
|
|
|
2021-09-18 01:22:33 +03:00
|
|
|
~SSOHandler();
|
2020-05-10 00:31:00 +03:00
|
|
|
|
2021-09-18 01:22:33 +03:00
|
|
|
std::string url() const;
|
2020-05-10 00:31:00 +03:00
|
|
|
|
|
|
|
signals:
|
2021-09-18 01:22:33 +03:00
|
|
|
void ssoSuccess(std::string token);
|
|
|
|
void ssoFailed();
|
2020-05-10 00:31:00 +03:00
|
|
|
|
|
|
|
private:
|
2021-09-18 01:22:33 +03:00
|
|
|
httplib::Server svr;
|
|
|
|
int port = 0;
|
2020-05-10 00:31:00 +03:00
|
|
|
};
|