Skip to content

Commit

Permalink
Do not display the password in the dialog when requesting credentials
Browse files Browse the repository at this point in the history
  • Loading branch information
Gustry authored and nyalldawson committed Jul 25, 2023
1 parent f6c6870 commit 65818fb
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/gui/qgscredentialdialog.cpp
Expand Up @@ -18,6 +18,7 @@
#include "qgscredentialdialog.h"

#include "qgsauthmanager.h"
#include "qgsdatasourceuri.h"
#include "qgslogger.h"
#include "qgssettings.h"
#include "qgsapplication.h"
Expand Down Expand Up @@ -90,7 +91,7 @@ QgsCredentialDialog::QgsCredentialDialog( QWidget *parent, Qt::WindowFlags fl )
// Keep a cache of ignored connections, and ignore them for 10 seconds.
connect( mIgnoreButton, &QPushButton::clicked, this, [ = ]( bool )
{
const QString realm { labelRealm->text() };
const QString realm { mRealm };
{
const QMutexLocker locker( &sIgnoredConnectionsCacheMutex );
// Insert the realm in the cache of ignored connections
Expand Down Expand Up @@ -146,7 +147,8 @@ void QgsCredentialDialog::requestCredentials( const QString &realm, QString *use
stackedWidget->setCurrentIndex( 0 );
mIgnoreButton->show();
chkbxPasswordHelperEnable->setChecked( QgsApplication::authManager()->passwordHelperEnabled() );
labelRealm->setText( realm );
labelRealm->setText( QgsDataSourceUri::removePassword( realm ) );
mRealm = realm;
leUsername->setText( *username );
lePassword->setText( *password );
labelMessage->setText( message );
Expand Down
2 changes: 2 additions & 0 deletions src/gui/qgscredentialdialog.h
Expand Up @@ -76,6 +76,8 @@ class GUI_EXPORT QgsCredentialDialog : public QDialog, public QgsCredentials, pr
//! mutex for the static ignored connections cache
static QMutex sIgnoredConnectionsCacheMutex;

QString mRealm;

ConnectionsIgnoreMode mIgnoreMode = ConnectionsIgnoreMode::IgnoreTemporarily;

};
Expand Down

0 comments on commit 65818fb

Please sign in to comment.