diff options
| author | Juha Vuolle <juha.vuolle@qt.io> | 2024-12-04 12:04:10 +0200 |
|---|---|---|
| committer | Juha Vuolle <juha.vuolle@qt.io> | 2024-12-10 09:36:47 +0200 |
| commit | 82bdff91875b78f154b4e19e43ba3b4e7f0991f6 (patch) | |
| tree | e696e7dcc2f82a68cc280a5810fbf96a607310c1 /src/oauth/qoauth2authorizationcodeflow.cpp | |
| parent | 70ddd6b3e059e075a8ae9eb307f8573a9dcc3d7e (diff) | |
Finetune token expiration convenience functionality
- Detect case where refresh threshold is larger than token lifetime
- Distinguish between client-side and server-side refresh timer
updates in order to handle timeouts appropriately. An immediate
refresh should only occur if initiated by client-side, in which
case it happens only once (after that, the next update is
initiated by server-side)
- Minimum timeout value to avoid unthrottled refresh loop in case
of a server misconfiguration
- Simplify auto test cases by combining the two cases into a single
data-driven case
- Single out two corner-case autotests
Pick-to: 6.9
Change-Id: Ia538e8b308564dc6f3e42103d72e724bbf226b69
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
Diffstat (limited to 'src/oauth/qoauth2authorizationcodeflow.cpp')
| -rw-r--r-- | src/oauth/qoauth2authorizationcodeflow.cpp | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/src/oauth/qoauth2authorizationcodeflow.cpp b/src/oauth/qoauth2authorizationcodeflow.cpp index 11583e0..1d86a42 100644 --- a/src/oauth/qoauth2authorizationcodeflow.cpp +++ b/src/oauth/qoauth2authorizationcodeflow.cpp @@ -177,8 +177,7 @@ void QOAuth2AuthorizationCodeFlowPrivate::initializeAutoRefresh() { Q_Q(QOAuth2AuthorizationCodeFlow); QObject::connect(q, &QAbstractOAuth2::accessTokenAboutToExpire, q, [q] { - if (q->autoRefresh() && !(q->refreshToken().isEmpty()) - && (!(q->status() == QOAuth2AuthorizationCodeFlow::Status::RefreshingToken))) + if (q->autoRefresh() && !q->refreshToken().isEmpty()) q->refreshAccessToken(); }); } |
