Temporary account creation flow is only supported on matrix.org
This commit is contained in:
parent
aab5a27a91
commit
a4e93ebe27
1 changed files with 6 additions and 0 deletions
|
|
@ -9,11 +9,13 @@ package io.element.android.features.login.impl.web
|
||||||
|
|
||||||
import android.net.Uri
|
import android.net.Uri
|
||||||
import com.squareup.anvil.annotations.ContributesBinding
|
import com.squareup.anvil.annotations.ContributesBinding
|
||||||
|
import io.element.android.appconfig.AuthenticationConfig
|
||||||
import io.element.android.features.login.impl.resolver.network.WellknownAPI
|
import io.element.android.features.login.impl.resolver.network.WellknownAPI
|
||||||
import io.element.android.features.login.impl.screens.createaccount.AccountCreationNotSupported
|
import io.element.android.features.login.impl.screens.createaccount.AccountCreationNotSupported
|
||||||
import io.element.android.libraries.di.AppScope
|
import io.element.android.libraries.di.AppScope
|
||||||
import io.element.android.libraries.network.RetrofitFactory
|
import io.element.android.libraries.network.RetrofitFactory
|
||||||
import java.net.HttpURLConnection
|
import java.net.HttpURLConnection
|
||||||
|
import timber.log.Timber
|
||||||
import javax.inject.Inject
|
import javax.inject.Inject
|
||||||
|
|
||||||
interface WebClientUrlForAuthenticationRetriever {
|
interface WebClientUrlForAuthenticationRetriever {
|
||||||
|
|
@ -25,6 +27,10 @@ class DefaultWebClientUrlForAuthenticationRetriever @Inject constructor(
|
||||||
private val retrofitFactory: RetrofitFactory,
|
private val retrofitFactory: RetrofitFactory,
|
||||||
) : WebClientUrlForAuthenticationRetriever {
|
) : WebClientUrlForAuthenticationRetriever {
|
||||||
override suspend fun retrieve(homeServerUrl: String): String {
|
override suspend fun retrieve(homeServerUrl: String): String {
|
||||||
|
if (homeServerUrl != AuthenticationConfig.MATRIX_ORG_URL) {
|
||||||
|
Timber.w("Temporary account creation flow is only supported on matrix.org")
|
||||||
|
throw AccountCreationNotSupported()
|
||||||
|
}
|
||||||
val wellknownApi = retrofitFactory.create(homeServerUrl)
|
val wellknownApi = retrofitFactory.create(homeServerUrl)
|
||||||
.create(WellknownAPI::class.java)
|
.create(WellknownAPI::class.java)
|
||||||
val result = try {
|
val result = try {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue