Skip to content
Permalink
Browse files

[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 authored and nirvn committed May 13, 2019
1 parent 0e401cc commit 7c6848aae4e533689b8faa7cdd815dd0630dce76
Showing with 3 additions and 1 deletion.
  1. +3 −1 external/o2/src/o2.cpp
@@ -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();

0 comments on commit 7c6848a

Please sign in to comment.
You can’t perform that action at this time.