Skip to content

Commit

Permalink
Merge pull request #59963 from nyalldawson/o2_expiry
Browse files Browse the repository at this point in the history
Port oauth2 expiry message fix
  • Loading branch information
alexbruy authored Dec 19, 2024
2 parents c0e743d + b5b7c31 commit 80e56a4
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 80e56a4

Please sign in to comment.