Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
[o2] A new refresh_token is not a mandatory part of the response
after requesting a refresh

The server will always return a new access_token, but returning
a new refresh_token is optional
  • Loading branch information
nyalldawson committed May 9, 2019
1 parent 69c8915 commit 9364d1f
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion external/o2/src/o2.cpp
Expand Up @@ -437,7 +437,9 @@ void O2::onRefreshFinished() {
QVariantMap tokens = parseTokenResponse(reply);
setToken(tokens.value(O2_OAUTH2_ACCESS_TOKEN).toString());
setExpires(QDateTime::currentMSecsSinceEpoch() / 1000 + tokens.value(O2_OAUTH2_EXPIRES_IN).toInt());
setRefreshToken(tokens.value(O2_OAUTH2_REFRESH_TOKEN).toString());
const QString refreshToken = tokens.value(O2_OAUTH2_REFRESH_TOKEN).toString();
if ( !refreshToken.isEmpty() )
setRefreshToken(refreshToken);
timedReplies_.remove(refreshReply);
setLinked(true);
Q_EMIT linkingSucceeded();
Expand Down

0 comments on commit 9364d1f

Please sign in to comment.