Skip to content

Commit e42fa85

Browse files
committed
Make the CI happy
1 parent 9f96b8f commit e42fa85

File tree

2 files changed

+5
-8
lines changed

2 files changed

+5
-8
lines changed

src/core/qfieldcloudconnection.cpp

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -624,14 +624,11 @@ void QFieldCloudConnection::setAuthenticationDetails( QNetworkRequest &request )
624624
request.setRawHeader( "X-QFC-IDP-ID", providerId.toLatin1() );
625625

626626
const QList<QNetworkCookie> cookies = QgsNetworkAccessManager::instance()->cookieJar()->cookiesForUrl( mUrl );
627-
for ( const QNetworkCookie &cookie : cookies )
627+
auto match = std::find_if( cookies.begin(), cookies.end(), []( const QNetworkCookie &cookie ) { return cookie.name() == QLatin1String( "csrftoken" ); } );
628+
if ( match != cookies.end() )
628629
{
629-
if ( cookie.name() == QLatin1String( "csrftoken" ) )
630-
{
631-
request.setRawHeader( "X-CSRFToken", cookie.value() );
632-
request.setRawHeader( "Referer", mUrl.toLatin1() );
633-
break;
634-
}
630+
request.setRawHeader( "X-CSRFToken", match->value() );
631+
request.setRawHeader( "Referer", mUrl.toLatin1() );
635632
}
636633
}
637634
}

src/qml/QFieldCloudLogin.qml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -233,7 +233,7 @@ Item {
233233
font: Theme.tipFont
234234
color: Theme.secondaryTextColor
235235
horizontalAlignment: Qt.AlignHCenter
236-
visible: cloudConnection.status === QFieldCloudConnection.Disconnected && (qfieldCloudLogin.hasCredentialsAuthentication && availableProvidersRepeater.count > 2 || availableProvidersRepeater.count > 1)
236+
visible: cloudConnection.status === QFieldCloudConnection.Disconnected && (qfieldCloudLogin.hasCredentialsAuthentication && availableProvidersRepeater.count >= 2)
237237
}
238238

239239
Repeater {

0 commit comments

Comments
 (0)