Skip to content

Commit 11bd40f

Browse files
committed
fix(android): prefer bootstrap auth on qr pairing
1 parent 911f9a1 commit 11bd40f

2 files changed

Lines changed: 4 additions & 4 deletions

File tree

apps/android/app/src/main/java/ai/openclaw/app/gateway/GatewaySession.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -886,7 +886,7 @@ class GatewaySession(
886886
explicitGatewayToken
887887
?: if (
888888
explicitPassword == null &&
889-
(explicitBootstrapToken == null || storedToken != null)
889+
explicitBootstrapToken == null
890890
) {
891891
storedToken
892892
} else {

apps/android/app/src/test/java/ai/openclaw/app/gateway/GatewaySessionInvokeTest.kt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ class GatewaySessionInvokeTest {
111111
}
112112

113113
@Test
114-
fun connect_prefersStoredDeviceTokenOverBootstrapToken() = runBlocking {
114+
fun connect_prefersBootstrapTokenOverStoredDeviceToken() = runBlocking {
115115
val json = testJson()
116116
val connected = CompletableDeferred<Unit>()
117117
val connectAuth = CompletableDeferred<JsonObject?>()
@@ -148,8 +148,8 @@ class GatewaySessionInvokeTest {
148148
awaitConnectedOrThrow(connected, lastDisconnect, server)
149149

150150
val auth = withTimeout(TEST_TIMEOUT_MS) { connectAuth.await() }
151-
assertEquals("device-token", auth?.get("token")?.jsonPrimitive?.content)
152-
assertNull(auth?.get("bootstrapToken"))
151+
assertEquals("bootstrap-token", auth?.get("bootstrapToken")?.jsonPrimitive?.content)
152+
assertNull(auth?.get("token"))
153153
} finally {
154154
shutdownHarness(harness, server)
155155
}

0 commit comments

Comments
 (0)