| 1 | // SPDX-FileCopyrightText: Nheko Contributors |
| 2 | // |
| 3 | // SPDX-License-Identifier: GPL-3.0-or-later |
| 4 | |
| 5 | #pragma once |
| 6 | |
| 7 | #include "httplib.h" |
| 8 | |
| 9 | #include <QObject> |
| 10 | #include <string> |
| 11 | |
| 12 | class SSOHandler final : public QObject |
| 13 | { |
| 14 | Q_OBJECT |
| 15 | |
| 16 | public: |
| 17 | SSOHandler(QObject *parent = nullptr); |
| 18 | |
| 19 | ~SSOHandler(); |
| 20 | |
| 21 | std::string url() const; |
| 22 | |
| 23 | signals: |
| 24 | void ssoSuccess(std::string token); |
| 25 | void ssoFailed(); |
| 26 | |
| 27 | private: |
| 28 | httplib::Server svr; |
| 29 | int port = 0; |
| 30 | }; |