mirror of
https://github.com/nextcloud/talk-android
synced 2025-08-06 19:45:03 +01:00
Merge pull request #5189 from nextcloud/issue-fix-login-v2-poll-url
Fixed Login V2 Bug
This commit is contained in:
commit
8203ca691d
@ -26,6 +26,8 @@ import org.junit.Before
|
||||
import org.junit.Test
|
||||
import org.junit.runner.RunWith
|
||||
import java.lang.Boolean
|
||||
import kotlin.Long
|
||||
import kotlin.String
|
||||
|
||||
@RunWith(AndroidJUnit4::class)
|
||||
class ChatBlocksDaoTest {
|
||||
@ -58,6 +60,7 @@ class ChatBlocksDaoTest {
|
||||
val account1 = usersDao.getUserWithUserId("account1").blockingGet()
|
||||
|
||||
conversationsDao.upsertConversations(
|
||||
accountId = user.id,
|
||||
listOf(
|
||||
createConversationEntity(
|
||||
accountId = account1.id,
|
||||
|
@ -85,6 +85,7 @@ class BrowserLoginActivity : BaseActivity() {
|
||||
private val loginFlowExecutorService: ScheduledExecutorService? = Executors.newSingleThreadScheduledExecutor()
|
||||
private var isLoginProcessCompleted = false
|
||||
private var token: String = ""
|
||||
private var pollUrl: String = ""
|
||||
|
||||
private lateinit var okHttpClient: OkHttpClient
|
||||
|
||||
@ -163,6 +164,7 @@ class BrowserLoginActivity : BaseActivity() {
|
||||
launchDefaultWebBrowser(loginUrl)
|
||||
}
|
||||
token = jsonObject.getAsJsonObject("poll").get("token").asString
|
||||
pollUrl = jsonObject.getAsJsonObject("poll").get("endpoint").asString
|
||||
} catch (e: SSLHandshakeException) {
|
||||
Log.e(TAG, "Error caught at anonymouslyPostLoginRequest: $e")
|
||||
}
|
||||
@ -215,14 +217,12 @@ class BrowserLoginActivity : BaseActivity() {
|
||||
}
|
||||
|
||||
private fun performLoginFlowV2() {
|
||||
val postRequestUrl = "$baseUrl/login/v2/poll"
|
||||
|
||||
val requestBody: RequestBody = FormBody.Builder()
|
||||
.add("token", token)
|
||||
.build()
|
||||
|
||||
val request = Request.Builder()
|
||||
.url(postRequestUrl)
|
||||
.url(pollUrl)
|
||||
.post(requestBody)
|
||||
.build()
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user