Allow adding a path suffix to the OAuth client URI (#7286)

* Allow adding a path suffix to the OAuth client URI
This commit is contained in:
Jorge Martin Espinosa
2026-07-29 11:29:44 +02:00
committed by GitHub
parent 674354b1a6
commit 49692794f9
3 changed files with 10 additions and 1 deletions
+5
View File
@@ -24,6 +24,11 @@ android {
}
defaultConfig {
buildConfigField(
name = "OAUTH_CLIENT_URI_PATH",
type = "String",
value = BuildTimeConfig.OAUTH_CLIENT_URL_PATH?.let { "\"$it\"" } ?: "null",
)
buildConfigFieldStr(
name = "CLIENT_URI",
value = BuildTimeConfig.URL_WEBSITE ?: "https://element.io"
@@ -11,7 +11,10 @@ package io.element.android.libraries.matrix.api.auth
import io.element.android.libraries.matrix.api.BuildConfig
object OAuthConfig {
const val CLIENT_URI = BuildConfig.CLIENT_URI
val CLIENT_URI = BuildConfig.OAUTH_CLIENT_URI_PATH?.let {
// Concatenate the base URI and the path, ensuring there is exactly one '/' between them
"${BuildConfig.CLIENT_URI.trimEnd('/')}/${it.trimStart('/')}"
} ?: BuildConfig.CLIENT_URI
// Note: host must match with the host of CLIENT_URI
const val LOGO_URI = BuildConfig.LOGO_URI
@@ -22,6 +22,7 @@ object BuildTimeConfig {
val URL_ACCEPTABLE_USE: String? = null
val URL_PRIVACY: String? = null
val URL_POLICY: String? = null
val OAUTH_CLIENT_URL_PATH: String? = null
val SERVICES_MAPTILER_BASE_URL: String? = null
val SERVICES_MAPTILER_APIKEY: String? = null
val SERVICES_MAPTILER_LIGHT_MAPID: String? = null