diff options
| author | Jesus Fernandez <jesus.fernandez@qt.io> | 2018-01-18 14:07:59 +0100 |
|---|---|---|
| committer | Jesus Fernandez <Jesus.Fernandez@qt.io> | 2018-02-13 19:38:17 +0000 |
| commit | 17d654536d544f33bf1e588d3702cdc95de7841e (patch) | |
| tree | bd0e116de33ab38a6e8855afdaf64f79c5db946d /src/oauth/qoauth2authorizationcodeflow.cpp | |
| parent | 40c00e2df2130d153968e7ddedfedc654fc55970 (diff) | |
Fix refresh token workflowv5.11.0-alpha1
The workflow for refresh token was not working properly due to a
missing QObject::connect(). Getting the access token and refreshing it
later was working, but only because the connection was done in
QOAuth2AuthorizationCodeFlow::requestAccessToken().
The patch adds a couple of tests to check both workflows.
Task-number: QTBUG-65778
Change-Id: Id89f2e9f64d5285fc6cd24c9c4afd430b8925239
Reviewed-by: MÃ¥rten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Kamil Rojewski <kamil.rojewski@gmail.com>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Diffstat (limited to 'src/oauth/qoauth2authorizationcodeflow.cpp')
| -rw-r--r-- | src/oauth/qoauth2authorizationcodeflow.cpp | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/oauth/qoauth2authorizationcodeflow.cpp b/src/oauth/qoauth2authorizationcodeflow.cpp index dff04a2..5e95f7a 100644 --- a/src/oauth/qoauth2authorizationcodeflow.cpp +++ b/src/oauth/qoauth2authorizationcodeflow.cpp @@ -331,6 +331,9 @@ void QOAuth2AuthorizationCodeFlow::refreshAccessToken() connect(reply, &QNetworkReply::finished, [handler, reply]() { handler->networkReplyFinished(reply); }); connect(reply, &QNetworkReply::finished, reply, &QNetworkReply::deleteLater); + QObjectPrivate::connect(d->replyHandler.data(), &QAbstractOAuthReplyHandler::tokensReceived, d, + &QOAuth2AuthorizationCodeFlowPrivate::_q_accessTokenRequestFinished, + Qt::UniqueConnection); QObjectPrivate::connect(d->networkAccessManager(), &QNetworkAccessManager::authenticationRequired, d, &QOAuth2AuthorizationCodeFlowPrivate::_q_authenticate, |
