Skip to content

Commit c4d9118

Browse files
committed
Oauth: Close the local server once we are done
Close the local server so a second authentication (reopen button pressed) is not possible Fixes: #8951
1 parent c4eb565 commit c4d9118

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/libsync/creds/oauth.cpp

+5
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828
#include <QJsonObject>
2929
#include <QNetworkReply>
3030
#include <QRandomGenerator>
31+
#include <QScopeGuard>
3132
#include <QTimer>
3233

3334
using namespace OCC;
@@ -230,6 +231,10 @@ void OAuth::startAuthentication()
230231
{ QStringLiteral("code_verifier"), QString::fromUtf8(_pkceCodeVerifier) },
231232
});
232233
QObject::connect(job, &SimpleNetworkJob::finishedSignal, this, [this, socket](QNetworkReply *reply) {
234+
qScopeGuard([this] {
235+
// close the server once we are done here
236+
_server.close();
237+
});
233238
const auto jsonData = reply->readAll();
234239
QJsonParseError jsonParseError;
235240
const auto data = QJsonDocument::fromJson(jsonData, &jsonParseError).object().toVariantMap();

0 commit comments

Comments
 (0)