refactor: simplify the code

This commit is contained in:
Kevin Yue
2022-06-12 17:34:23 +08:00
parent 5ebfe9b0f4
commit cb457c4b09
14 changed files with 128 additions and 175 deletions

View File

@@ -33,23 +33,18 @@ SAMLLoginWindow::SAMLLoginWindow(QWidget *parent)
});
}
SAMLLoginWindow::~SAMLLoginWindow()
{
delete webView;
}
void SAMLLoginWindow::closeEvent(QCloseEvent *event)
{
event->accept();
reject();
}
void SAMLLoginWindow::login(const QString samlMethod, const QString samlRequest, const QString preloingUrl)
void SAMLLoginWindow::login(const QString samlMethod, const QString samlRequest, const QString preloginUrl)
{
webView->page()->profile()->cookieStore()->deleteSessionCookies();
if (samlMethod == "POST") {
webView->setHtml(samlRequest, preloingUrl);
webView->setHtml(samlRequest, preloginUrl);
} else if (samlMethod == "REDIRECT") {
LOGI << "Redirect to " << samlRequest;
webView->load(samlRequest);