[API/Librus] Fix some more captcha errors.

This commit is contained in:
Kuba Szczodrzyński 2020-05-16 20:52:16 +02:00
parent 907b75b22d
commit e02d3e571d

View File

@ -38,14 +38,18 @@ class LibrusLoginMessages(val data: DataLibrus, val onSuccess: () -> Unit) {
text?.contains("grecaptcha.ready") == true -> { text?.contains("grecaptcha.ready") == true -> {
val url = response?.request()?.url()?.toString() ?: run { val url = response?.request()?.url()?.toString() ?: run {
data.error(TAG, ERROR_LIBRUS_MESSAGES_OTHER, response, text) //data.error(TAG, ERROR_LIBRUS_MESSAGES_OTHER, response, text)
data.messagesLoginSuccessful = false
onSuccess()
return return
} }
LibrusRecaptchaHelper(data.app, url, text, onSuccess = { newUrl -> LibrusRecaptchaHelper(data.app, url, text, onSuccess = { newUrl ->
loginWithSynergia(newUrl) loginWithSynergia(newUrl)
}, onTimeout = { }, onTimeout = {
data.error(TAG, ERROR_LOGIN_LIBRUS_MESSAGES_TIMEOUT, response, text) //data.error(TAG, ERROR_LOGIN_LIBRUS_MESSAGES_TIMEOUT, response, text)
data.messagesLoginSuccessful = false
onSuccess()
}) })
} }