Fix no enum constant found on umt.tarnow.pl login

This commit is contained in:
Mikołaj Pich 2020-09-27 17:39:53 +02:00
parent b94a4c1eec
commit 3ce92d979e
3 changed files with 1 additions and 5 deletions

View file

@ -25,7 +25,6 @@ class Scrapper {
AUTO,
STANDARD,
ADFS,
ADFSMS,
ADFSCards,
ADFSLight,
ADFSLightScoped,

View file

@ -6,7 +6,6 @@ import io.github.wulkanowy.sdk.scrapper.Scrapper.LoginType.ADFSCards
import io.github.wulkanowy.sdk.scrapper.Scrapper.LoginType.ADFSLight
import io.github.wulkanowy.sdk.scrapper.Scrapper.LoginType.ADFSLightCufs
import io.github.wulkanowy.sdk.scrapper.Scrapper.LoginType.ADFSLightScoped
import io.github.wulkanowy.sdk.scrapper.Scrapper.LoginType.ADFSMS
import io.github.wulkanowy.sdk.scrapper.Scrapper.LoginType.AUTO
import io.github.wulkanowy.sdk.scrapper.Scrapper.LoginType.STANDARD
import io.github.wulkanowy.sdk.scrapper.ScrapperException
@ -71,7 +70,6 @@ class LoginHelper(
if (host == "umt.tarnow.pl") sendADFSMS(email, password) // legacy
else sendADFS(it, password)
}
ADFSMS -> sendADFSMS(it, password)
ADFSLight, ADFSLightScoped, ADFSLightCufs -> sendADFSLightGeneric(it, password, loginType)
ADFSCards -> sendADFSCards(it, password)
}

View file

@ -81,8 +81,7 @@ class RegisterRepository(
val page = register.getFormType(urlGenerator.generate(ServiceManager.UrlGenerator.Site.LOGIN) + "Account/LogOn").page
return when {
page.select(SELECTOR_STANDARD).isNotEmpty() -> Scrapper.LoginType.STANDARD
page.select(SELECTOR_ADFS).isNotEmpty() -> Scrapper.LoginType.ADFS
page.select(SELECTOR_ADFS_MS).isNotEmpty() -> Scrapper.LoginType.ADFSMS
page.select(SELECTOR_ADFS).isNotEmpty() || page.select(SELECTOR_ADFS_MS).isNotEmpty() -> Scrapper.LoginType.ADFS
page.select(SELECTOR_ADFS_LIGHT).isNotEmpty() -> {
page.selectFirst("form").attr("action").run {
when {