Improve code

This commit is contained in:
Kevin Yue
2020-05-23 21:33:52 +08:00
parent 7f5bf0ce52
commit e22bb8e1b7
14 changed files with 61 additions and 51 deletions

View File

@@ -24,7 +24,6 @@ PortalAuthenticator::~PortalAuthenticator()
delete normalLoginWindow;
}
void PortalAuthenticator::authenticate()
{
PLOGI << "Preform portal prelogin at " << preloginUrl;
@@ -88,10 +87,9 @@ void PortalAuthenticator::normalAuth()
// Do login
connect(normalLoginWindow, &NormalLoginWindow::performLogin, this, &PortalAuthenticator::onPerformNormalLogin);
connect(normalLoginWindow, &NormalLoginWindow::rejected, this, &PortalAuthenticator::onLoginWindowRejected);
connect(normalLoginWindow, &NormalLoginWindow::finished, this, &PortalAuthenticator::onLoginWindowFinished);
normalLoginWindow->exec();
delete normalLoginWindow;
normalLoginWindow = nullptr;
normalLoginWindow->show();
}
void PortalAuthenticator::onPerformNormalLogin(const QString &username, const QString &password)
@@ -105,6 +103,12 @@ void PortalAuthenticator::onLoginWindowRejected()
emitFail();
}
void PortalAuthenticator::onLoginWindowFinished()
{
delete normalLoginWindow;
normalLoginWindow = nullptr;
}
void PortalAuthenticator::samlAuth()
{
PLOGI << "Trying to perform SAML login with saml-method " << preloginResponse.samlMethod();