Skip to content

Commit

Permalink
Merge pull request #59967 from qgis/backport-59963-to-release-3_40
Browse files Browse the repository at this point in the history
[Backport release-3_40] Port oauth2 expiry message fix
  • Loading branch information
rouault authored Dec 20, 2024
2 parents bda147c + 4005034 commit ee44ed5
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/auth/oauth2/core/qgso2.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -500,12 +500,13 @@ void QgsO2::refreshSynchronous()
else
{
setToken( tokens.value( O2_OAUTH2_ACCESS_TOKEN ).toString() );
setExpires( QDateTime::currentMSecsSinceEpoch() / 1000 + static_cast<qint64>( tokens.value( O2_OAUTH2_EXPIRES_IN ).toInt() ) );
const int expiresIn = tokens.value( O2_OAUTH2_EXPIRES_IN ).toInt();
setExpires( QDateTime::currentMSecsSinceEpoch() / 1000 + static_cast<qint64>( 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 );
Expand Down

0 comments on commit ee44ed5

Please sign in to comment.