Update api login information with user input
This commit is contained in:
parent
da4bdd2355
commit
b14b34441b
@ -203,13 +203,7 @@ class LoginActivity() : AppCompatActivity(), DIAware {
|
|||||||
} else {
|
} else {
|
||||||
showProgress(true)
|
showProgress(true)
|
||||||
|
|
||||||
settings.putString("url", url)
|
repository.refreshLoginInformation(url, login, password, httpLogin, httpPassword, isWithSelfSignedCert)
|
||||||
settings.putString("login", login)
|
|
||||||
settings.putString("httpUserName", httpLogin)
|
|
||||||
settings.putString("password", password)
|
|
||||||
settings.putString("httpPassword", httpPassword)
|
|
||||||
settings.putBoolean("isSelfSignedCert", isWithSelfSignedCert)
|
|
||||||
repository.refreshLoginInformation()
|
|
||||||
|
|
||||||
if (this@LoginActivity.isNetworkAvailable(this@LoginActivity.findViewById(R.id.loginForm))) {
|
if (this@LoginActivity.isNetworkAvailable(this@LoginActivity.findViewById(R.id.loginForm))) {
|
||||||
CoroutineScope(Dispatchers.IO).launch {
|
CoroutineScope(Dispatchers.IO).launch {
|
||||||
|
@ -35,5 +35,7 @@ interface Repository {
|
|||||||
suspend fun deleteSource(id: Int): Boolean
|
suspend fun deleteSource(id: Int): Boolean
|
||||||
suspend fun updateRemote(): Boolean
|
suspend fun updateRemote(): Boolean
|
||||||
suspend fun login(): Boolean
|
suspend fun login(): Boolean
|
||||||
fun refreshLoginInformation()
|
fun refreshLoginInformation(url: String, login: String, password: String,
|
||||||
|
httpLogin: String, httpPassword: String,
|
||||||
|
isSelfSignedCert: Boolean)
|
||||||
}
|
}
|
@ -275,9 +275,17 @@ class RepositoryImpl(private val api: SelfossApi, private val apiDetails: ApiDet
|
|||||||
return result
|
return result
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun refreshLoginInformation() {
|
override fun refreshLoginInformation(url: String, login: String, password: String,
|
||||||
|
httpLogin: String, httpPassword: String,
|
||||||
|
isSelfSignedCert: Boolean) {
|
||||||
|
settings.putString("url", url)
|
||||||
|
settings.putString("login", login)
|
||||||
|
settings.putString("httpUserName", httpLogin)
|
||||||
|
settings.putString("password", password)
|
||||||
|
settings.putString("httpPassword", httpPassword)
|
||||||
|
settings.putBoolean("isSelfSignedCert", isSelfSignedCert)
|
||||||
|
baseUrl = url
|
||||||
api.refreshLoginInformation()
|
api.refreshLoginInformation()
|
||||||
baseUrl = apiDetails.getBaseUrl()
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private suspend fun updateApiVersion() {
|
private suspend fun updateApiVersion() {
|
||||||
|
@ -47,7 +47,6 @@ class ApiDetailsServiceImpl : ApiDetailsService {
|
|||||||
_password = settings.getString("password", "")
|
_password = settings.getString("password", "")
|
||||||
_userName = settings.getString("login", "")
|
_userName = settings.getString("login", "")
|
||||||
_baseUrl = settings.getString("url", "")
|
_baseUrl = settings.getString("url", "")
|
||||||
_baseUrl = settings.getString("url", "")
|
|
||||||
_apiVersion = settings.getInt("apiVersionMajor", -1)
|
_apiVersion = settings.getInt("apiVersionMajor", -1)
|
||||||
}
|
}
|
||||||
}
|
}
|
Loading…
Reference in New Issue
Block a user