Skip to content

Commit 65818fb

Browse files
Gustrynyalldawson
authored andcommitted
Do not display the password in the dialog when requesting credentials
1 parent f6c6870 commit 65818fb

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

src/gui/qgscredentialdialog.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
#include "qgscredentialdialog.h"
1919

2020
#include "qgsauthmanager.h"
21+
#include "qgsdatasourceuri.h"
2122
#include "qgslogger.h"
2223
#include "qgssettings.h"
2324
#include "qgsapplication.h"
@@ -90,7 +91,7 @@ QgsCredentialDialog::QgsCredentialDialog( QWidget *parent, Qt::WindowFlags fl )
9091
// Keep a cache of ignored connections, and ignore them for 10 seconds.
9192
connect( mIgnoreButton, &QPushButton::clicked, this, [ = ]( bool )
9293
{
93-
const QString realm { labelRealm->text() };
94+
const QString realm { mRealm };
9495
{
9596
const QMutexLocker locker( &sIgnoredConnectionsCacheMutex );
9697
// Insert the realm in the cache of ignored connections
@@ -146,7 +147,8 @@ void QgsCredentialDialog::requestCredentials( const QString &realm, QString *use
146147
stackedWidget->setCurrentIndex( 0 );
147148
mIgnoreButton->show();
148149
chkbxPasswordHelperEnable->setChecked( QgsApplication::authManager()->passwordHelperEnabled() );
149-
labelRealm->setText( realm );
150+
labelRealm->setText( QgsDataSourceUri::removePassword( realm ) );
151+
mRealm = realm;
150152
leUsername->setText( *username );
151153
lePassword->setText( *password );
152154
labelMessage->setText( message );

src/gui/qgscredentialdialog.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,8 @@ class GUI_EXPORT QgsCredentialDialog : public QDialog, public QgsCredentials, pr
7676
//! mutex for the static ignored connections cache
7777
static QMutex sIgnoredConnectionsCacheMutex;
7878

79+
QString mRealm;
80+
7981
ConnectionsIgnoreMode mIgnoreMode = ConnectionsIgnoreMode::IgnoreTemporarily;
8082

8183
};

0 commit comments

Comments
 (0)