obs-studio/UI/auth-listener.hpp
Richard Stanway 0a13ce851d UI: Properly verify state parameter for YouTube auth
Very low risk of anything bad here since we use a random port and the
chance of a CSRF attack is tiny, but this is a best practie to do when
using OAuth.
2021-09-15 06:16:29 -07:00

24 lines
350 B
C++

#pragma once
#include <QObject>
#include <QtNetwork/QTcpServer>
class AuthListener : public QObject {
Q_OBJECT
QTcpServer *server;
QString state;
signals:
void ok(const QString &code);
void fail();
protected:
void NewConnection();
public:
explicit AuthListener(QObject *parent = 0);
quint16 GetPort();
void SetState(QString state);
};