Osdu: make sure token is valid before background loading.

This commit is contained in:
Kristian Bendiksen 2024-07-13 12:48:06 +02:00
parent 2651ca91b6
commit 76a1d43b0e
2 changed files with 21 additions and 2 deletions

View File

@ -48,6 +48,8 @@ public:
QString server() const;
QString requestTokenBlocking();
public slots:
void requestToken();
void requestFailed( const QAbstractOAuth::Error error );
@ -61,8 +63,6 @@ private slots:
void accessGranted();
protected:
QString requestTokenBlocking();
static QString constructAuthUrl( const QString& authority );
static QString constructTokenUrl( const QString& authority );

View File

@ -155,6 +155,25 @@ void RimWellPathCollection::loadDataAndUpdate()
readWellPathFormationFiles();
auto hasOsduData = []( const std::vector<RimWellPath*>& wellPaths ) -> bool
{
for ( RimWellPath* wellPath : wellPaths )
{
if ( dynamic_cast<RimOsduWellPath*>( wellPath ) )
{
return true;
}
}
return false;
};
if ( hasOsduData( allWellPaths() ) )
{
auto osduConnector = RiaApplication::instance()->makeOsduConnector();
osduConnector->requestTokenBlocking();
}
caf::DataLoadController* dataLoadController = caf::DataLoadController::instance();
const QString wellPathGeometryKeyword = "WELL_PATH_GEOMETRY";