Skip to content

Commit f009777

Browse files
committed
feat: set basic auth as default login method for QA variant
1 parent ad0c7e9 commit f009777

File tree

1 file changed

+16
-6
lines changed
  • owncloudApp/src/main/java/com/owncloud/android/presentation/authentication

1 file changed

+16
-6
lines changed

Diff for: owncloudApp/src/main/java/com/owncloud/android/presentation/authentication/LoginActivity.kt

+16-6
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
* @author Jorge Aguado Recio
1313
*
1414
* Copyright (C) 2012 Bartek Przybylski
15-
* Copyright (C) 2024 ownCloud GmbH.
15+
* Copyright (C) 2025 ownCloud GmbH.
1616
*
1717
* This program is free software: you can redistribute it and/or modify
1818
* it under the terms of the GNU General Public License version 2,
@@ -46,6 +46,7 @@ import androidx.core.net.toUri
4646
import androidx.core.view.isVisible
4747
import androidx.core.widget.doAfterTextChanged
4848
import com.owncloud.android.BuildConfig
49+
import com.owncloud.android.MainApp
4950
import com.owncloud.android.MainApp.Companion.accountType
5051
import com.owncloud.android.R
5152
import com.owncloud.android.data.authentication.KEY_USER_ID
@@ -372,13 +373,14 @@ class LoginActivity : AppCompatActivity(), SslUntrustedCertDialog.OnSslUntrusted
372373
}
373374

374375
private fun checkServerType(serverInfo: ServerInfo) {
376+
if (BuildConfig.FLAVOR == MainApp.QA_FLAVOR) {
377+
handleBasicAuth()
378+
return
379+
}
380+
375381
when (serverInfo) {
376382
is ServerInfo.BasicServer -> {
377-
authTokenType = BASIC_TOKEN_TYPE
378-
oidcSupported = false
379-
showOrHideBasicAuthFields(shouldBeVisible = true)
380-
binding.accountUsername.doAfterTextChanged { updateLoginButtonVisibility() }
381-
binding.accountPassword.doAfterTextChanged { updateLoginButtonVisibility() }
383+
handleBasicAuth()
382384
}
383385

384386
is ServerInfo.OAuth2Server -> {
@@ -416,6 +418,14 @@ class LoginActivity : AppCompatActivity(), SslUntrustedCertDialog.OnSslUntrusted
416418
}
417419
}
418420

421+
private fun handleBasicAuth() {
422+
authTokenType = BASIC_TOKEN_TYPE
423+
oidcSupported = false
424+
showOrHideBasicAuthFields(shouldBeVisible = true)
425+
binding.accountUsername.doAfterTextChanged { updateLoginButtonVisibility() }
426+
binding.accountPassword.doAfterTextChanged { updateLoginButtonVisibility() }
427+
}
428+
419429
private fun getServerInfoIsLoading() {
420430
binding.serverStatusText.run {
421431
text = getString(R.string.auth_testing_connection)

0 commit comments

Comments
 (0)