IllegalArgumentException

This commit is contained in:
Antony 2022-08-22 00:33:39 +02:00
parent af35ddf598
commit 24009c5caa
3 changed files with 11 additions and 5 deletions

View file

@ -30,8 +30,8 @@ class GithubApi(index: Int) : InAppAuthAPIManager(index){
}
override suspend fun login(data: InAppAuthAPI.LoginData): Boolean {
switchToNewAccount()
val username = data.username ?: throw ErrorLoadingException("Requires Username")
val password = data.password ?: throw ErrorLoadingException("Requires Password")
val username = data.username ?: throw IllegalArgumentException ("Requires Username")
val password = data.password ?: throw IllegalArgumentException ("Requires Password")
try {
setKey(accountId, GITHUB_USER_KEY, GithubOAuthEntity(username, password))
registerAccount()

View file

@ -124,8 +124,8 @@ class OpenSubtitlesApi(index: Int) : InAppAuthAPIManager(index), AbstractSubApi
}
override suspend fun login(data: InAppAuthAPI.LoginData): Boolean {
val username = data.username ?: throw ErrorLoadingException("Requires Username")
val password = data.password ?: throw ErrorLoadingException("Requires Password")
val username = data.username ?: throw IllegalArgumentException ("Requires Username")
val password = data.password ?: throw IllegalArgumentException ("Requires Password")
switchToNewAccount()
try {
if (initLogin(username, password)) {

View file

@ -27,6 +27,8 @@ import com.lagradost.cloudstream3.syncproviders.providers.MALApi.Companion.MAL_S
import com.lagradost.cloudstream3.syncproviders.providers.MALApi.Companion.MAL_TOKEN_KEY
import com.lagradost.cloudstream3.syncproviders.providers.MALApi.Companion.MAL_UNIXTIME_KEY
import com.lagradost.cloudstream3.syncproviders.providers.MALApi.Companion.MAL_USER_KEY
import com.lagradost.cloudstream3.syncproviders.providers.OpenSubtitlesApi
import com.lagradost.cloudstream3.syncproviders.providers.OpenSubtitlesApi.Companion.OPEN_SUBTITLES_USER_KEY
import com.lagradost.cloudstream3.utils.AppUtils.parseJson
import com.lagradost.cloudstream3.utils.AppUtils.toJson
import com.lagradost.cloudstream3.utils.BackupUtils.restore
@ -71,7 +73,11 @@ object BackupUtils {
// The plugins themselves are not backed up
PLUGINS_KEY,
PLUGINS_KEY_LOCAL
PLUGINS_KEY_LOCAL,
OPEN_SUBTITLES_USER_KEY,
"nginx_user", // Nginx user key
)
/** false if blacklisted key */