mirror of
https://github.com/overte-org/overte.git
synced 2025-08-06 18:50:00 +02:00
pull OAuth code from URL in domain-server
This commit is contained in:
parent
4a68c2e9c4
commit
c26fc7a838
1 changed files with 19 additions and 3 deletions
|
@ -16,6 +16,7 @@
|
||||||
#include <QtCore/QProcess>
|
#include <QtCore/QProcess>
|
||||||
#include <QtCore/QStandardPaths>
|
#include <QtCore/QStandardPaths>
|
||||||
#include <QtCore/QTimer>
|
#include <QtCore/QTimer>
|
||||||
|
#include <QtCore/QUrlQuery>
|
||||||
|
|
||||||
#include <gnutls/dtls.h>
|
#include <gnutls/dtls.h>
|
||||||
|
|
||||||
|
@ -969,9 +970,24 @@ bool DomainServer::handleHTTPRequest(HTTPConnection* connection, const QUrl& url
|
||||||
}
|
}
|
||||||
|
|
||||||
bool DomainServer::handleHTTPSRequest(HTTPSConnection* connection, const QUrl &url) {
|
bool DomainServer::handleHTTPSRequest(HTTPSConnection* connection, const QUrl &url) {
|
||||||
qDebug() << "HTTPS request received at" << url;
|
const QString URI_OAUTH = "/oauth";
|
||||||
qDebug() << "not handling";
|
if (url.path() == URI_OAUTH) {
|
||||||
return false;
|
qDebug() << "Handling an OAuth authorization.";
|
||||||
|
|
||||||
|
const QString CODE_QUERY_KEY = "code";
|
||||||
|
QString authorizationCode = QUrlQuery(url).queryItemValue(CODE_QUERY_KEY);
|
||||||
|
|
||||||
|
if (!authorizationCode.isEmpty()) {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
// respond with a 200 code indicating that login is complete
|
||||||
|
connection->respond(HTTPConnection::StatusCode200);
|
||||||
|
|
||||||
|
return true;
|
||||||
|
} else {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void DomainServer::refreshStaticAssignmentAndAddToQueue(SharedAssignmentPointer& assignment) {
|
void DomainServer::refreshStaticAssignmentAndAddToQueue(SharedAssignmentPointer& assignment) {
|
||||||
|
|
Loading…
Reference in a new issue