diff --git a/src/auth/oauth2/core/qgso2.cpp b/src/auth/oauth2/core/qgso2.cpp index 922cb6d58e83..2b26965ea05f 100644 --- a/src/auth/oauth2/core/qgso2.cpp +++ b/src/auth/oauth2/core/qgso2.cpp @@ -500,12 +500,13 @@ void QgsO2::refreshSynchronous() else { setToken( tokens.value( O2_OAUTH2_ACCESS_TOKEN ).toString() ); - setExpires( QDateTime::currentMSecsSinceEpoch() / 1000 + static_cast( tokens.value( O2_OAUTH2_EXPIRES_IN ).toInt() ) ); + const int expiresIn = tokens.value( O2_OAUTH2_EXPIRES_IN ).toInt(); + setExpires( QDateTime::currentMSecsSinceEpoch() / 1000 + static_cast( expiresIn ) ); const QString refreshToken = tokens.value( O2_OAUTH2_REFRESH_TOKEN ).toString(); if ( !refreshToken.isEmpty() ) setRefreshToken( refreshToken ); setLinked( true ); - QgsDebugMsgLevel( QStringLiteral( "New token expires in %1 seconds" ).arg( expires() ), 2 ); + QgsDebugMsgLevel( QStringLiteral( "New token expires in %1 seconds" ).arg( expiresIn ), 2 ); emit linkingSucceeded(); } emit refreshFinished( QNetworkReply::NoError );