2021-03-05 02:35:15 +03:00
|
|
|
// SPDX-FileCopyrightText: 2021 Nheko Contributors
|
|
|
|
//
|
|
|
|
// SPDX-License-Identifier: GPL-3.0-or-later
|
|
|
|
|
2021-03-28 05:42:01 +03:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include <Qt> // for OS defines
|
|
|
|
|
|
|
|
#ifndef Q_OS_ANDROID
|
2020-05-10 00:31:00 +03:00
|
|
|
#include "httplib.h"
|
|
|
|
|
|
|
|
#include <QObject>
|
|
|
|
#include <string>
|
|
|
|
|
|
|
|
class SSOHandler : public QObject
|
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
|
|
|
|
public:
|
|
|
|
SSOHandler(QObject *parent = nullptr);
|
|
|
|
|
|
|
|
~SSOHandler();
|
|
|
|
|
|
|
|
std::string url() const;
|
|
|
|
|
|
|
|
signals:
|
|
|
|
void ssoSuccess(std::string token);
|
|
|
|
void ssoFailed();
|
|
|
|
|
|
|
|
private:
|
|
|
|
httplib::Server svr;
|
|
|
|
int port = 0;
|
|
|
|
};
|
2021-03-28 05:42:01 +03:00
|
|
|
#endif
|