mirror of
https://github.com/nextcloud/desktop.git
synced 2024-11-28 03:49:20 +03:00
Merge pull request #758 from nextcloud/self-signed-login-flow
Allow to use the login flow with a self signed certificate
This commit is contained in:
commit
0f1395fdf0
1 changed files with 20 additions and 0 deletions
|
@ -41,6 +41,13 @@ class WebEnginePage : public QWebEnginePage {
|
||||||
public:
|
public:
|
||||||
WebEnginePage(QWebEngineProfile *profile, QObject* parent = nullptr);
|
WebEnginePage(QWebEngineProfile *profile, QObject* parent = nullptr);
|
||||||
QWebEnginePage * createWindow(QWebEnginePage::WebWindowType type) override;
|
QWebEnginePage * createWindow(QWebEnginePage::WebWindowType type) override;
|
||||||
|
void setUrl(const QUrl &url);
|
||||||
|
|
||||||
|
protected:
|
||||||
|
bool certificateError(const QWebEngineCertificateError &certificateError) override;
|
||||||
|
|
||||||
|
private:
|
||||||
|
QUrl _rootUrl;
|
||||||
};
|
};
|
||||||
|
|
||||||
// We need a separate class here, since we cannot simply return the same WebEnginePage object
|
// We need a separate class here, since we cannot simply return the same WebEnginePage object
|
||||||
|
@ -146,6 +153,19 @@ QWebEnginePage * WebEnginePage::createWindow(QWebEnginePage::WebWindowType type)
|
||||||
return view;
|
return view;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void WebEnginePage::setUrl(const QUrl &url) {
|
||||||
|
QWebEnginePage::setUrl(url);
|
||||||
|
_rootUrl = url;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool WebEnginePage::certificateError(const QWebEngineCertificateError &certificateError) {
|
||||||
|
if (certificateError.error() == QWebEngineCertificateError::CertificateAuthorityInvalid) {
|
||||||
|
return certificateError.url().host() == _rootUrl.host();
|
||||||
|
}
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
ExternalWebEnginePage::ExternalWebEnginePage(QWebEngineProfile *profile, QObject* parent) : QWebEnginePage(profile, parent) {
|
ExternalWebEnginePage::ExternalWebEnginePage(QWebEngineProfile *profile, QObject* parent) : QWebEnginePage(profile, parent) {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue