summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/oauth/qoauth1.cpp4
-rw-r--r--tests/auto/oauth1/tst_oauth1.cpp2
2 files changed, 3 insertions, 3 deletions
diff --git a/src/oauth/qoauth1.cpp b/src/oauth/qoauth1.cpp
index e23c21e..22b3597 100644
--- a/src/oauth/qoauth1.cpp
+++ b/src/oauth/qoauth1.cpp
@@ -597,9 +597,7 @@ void QOAuth1::grant()
// https://tools.ietf.org/html/rfc5849#section-2.2
resourceOwnerAuthorization(d->authorizationUrl, parameters);
}
- } else if (status == Status::Granted) {
- Q_EMIT granted();
- } else {
+ } else if (status == Status::NotAuthenticated) {
// Inherit class called QAbstractOAuth::setStatus(Status::NotAuthenticated);
setTokenCredentials(QString(), QString());
disconnect(connection);
diff --git a/tests/auto/oauth1/tst_oauth1.cpp b/tests/auto/oauth1/tst_oauth1.cpp
index e6d458c..cdde34d 100644
--- a/tests/auto/oauth1/tst_oauth1.cpp
+++ b/tests/auto/oauth1/tst_oauth1.cpp
@@ -525,11 +525,13 @@ void tst_OAuth1::grant()
QEventLoop eventLoop;
+ QSignalSpy grantSignalSpy(&o1, &QOAuth1::granted);
QTimer::singleShot(10000, &eventLoop, &QEventLoop::quit);
connect(&o1, &QOAuth1::granted, &eventLoop, &QEventLoop::quit);
o1.grant();
eventLoop.exec();
QVERIFY(tokenReceived);
+ QCOMPARE(grantSignalSpy.count(), 1);
QCOMPARE(o1.status(), QAbstractOAuth::Status::Granted);
}