summaryrefslogtreecommitdiffstats
path: root/examples/webenginewidgets
diff options
context:
space:
mode:
authorPeter Varga <pvarga@inf.u-szeged.hu>2015-08-11 17:02:17 +0200
committerAllan Sandfeld Jensen <allan.jensen@theqtcompany.com>2015-09-01 11:56:02 +0000
commitf55163c647e622a47bb52d8f9e96833f2a640960 (patch)
tree970545a69cec7135435feeccd97c18baa407962e /examples/webenginewidgets
parentd75f57fc4290e769d3f159e7fc464a6c28b867b3 (diff)
Fix use of empty credentials for HTTP and proxy authentication
Empty user and password fields are valid for HTTP and proxy authentication. Thus it does not mean that the authentication is cancelled. For informing the engine about the cancellation of the authentication dialog make QAuthenticator instance null. Change-Id: Iba1ce9d375b9b37c23f7a91fb583606d75d04af5 Reviewed-by: Kai Koehne <kai.koehne@theqtcompany.com>
Diffstat (limited to 'examples/webenginewidgets')
-rw-r--r--examples/webenginewidgets/browser/webview.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/examples/webenginewidgets/browser/webview.cpp b/examples/webenginewidgets/browser/webview.cpp
index 00ec40874..d56ab8025 100644
--- a/examples/webenginewidgets/browser/webview.cpp
+++ b/examples/webenginewidgets/browser/webview.cpp
@@ -273,6 +273,9 @@ void WebPage::authenticationRequired(const QUrl &requestUrl, QAuthenticator *aut
if (dialog.exec() == QDialog::Accepted) {
auth->setUser(passwordDialog.userNameLineEdit->text());
auth->setPassword(passwordDialog.passwordLineEdit->text());
+ } else {
+ // Set authenticator null if dialog is cancelled
+ *auth = QAuthenticator();
}
}
@@ -298,6 +301,9 @@ void WebPage::proxyAuthenticationRequired(const QUrl &requestUrl, QAuthenticator
if (dialog.exec() == QDialog::Accepted) {
auth->setUser(proxyDialog.userNameLineEdit->text());
auth->setPassword(proxyDialog.passwordLineEdit->text());
+ } else {
+ // Set authenticator null if dialog is cancelled
+ *auth = QAuthenticator();
}
}