mirror of
https://github.com/Ashinch/ReadYou.git
synced 2025-02-07 15:48:50 +01:00
Fix the "Not valid credentials" issue caused by trailing separator in server URL (#357)
This commit is contained in:
parent
b152c263ac
commit
d9b707db80
@ -12,8 +12,11 @@ import androidx.compose.material.icons.rounded.RssFeed
|
||||
import androidx.compose.material3.Icon
|
||||
import androidx.compose.material3.Text
|
||||
import androidx.compose.material3.TextButton
|
||||
import androidx.compose.runtime.*
|
||||
import androidx.compose.runtime.Composable
|
||||
import androidx.compose.runtime.getValue
|
||||
import androidx.compose.runtime.mutableStateOf
|
||||
import androidx.compose.runtime.saveable.rememberSaveable
|
||||
import androidx.compose.runtime.setValue
|
||||
import androidx.compose.ui.Modifier
|
||||
import androidx.compose.ui.platform.LocalContext
|
||||
import androidx.compose.ui.platform.LocalFocusManager
|
||||
@ -112,7 +115,9 @@ fun AddFeverAccountDialog(
|
||||
type = AccountType.Fever,
|
||||
name = context.getString(R.string.fever),
|
||||
securityKey = FeverSecurityKey(
|
||||
serverUrl = serverUrl,
|
||||
serverUrl = serverUrl
|
||||
.takeIf { !it.endsWith("/") }
|
||||
?: serverUrl.trimEnd('/'),
|
||||
username = username,
|
||||
password = password,
|
||||
).toString(),
|
||||
|
@ -71,6 +71,8 @@ fun LazyItemScope.FeverConnection(
|
||||
onConfirm = {
|
||||
if (securityKey.serverUrl?.isNotBlank() == true) {
|
||||
securityKey.serverUrl = serverUrlValue
|
||||
?.takeIf { !it.endsWith("/") }
|
||||
?: serverUrlValue?.trimEnd('/')
|
||||
save(account, viewModel, securityKey)
|
||||
serverUrlDialogVisible = false
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user