@@ -52,7 +52,7 @@ interface GatewayContextValue {
5252 status : ConnectionStatus
5353 snapshot : GatewaySnapshot | null
5454 error : string | null
55- connect : ( url : string , password : string ) => void
55+ connect : ( url : string , credential : string ) => void
5656 disconnect : ( ) => void
5757 reconnect : ( ) => void
5858 sendRequest : ( method : string , params ?: Record < string , unknown > ) => Promise < unknown >
@@ -81,7 +81,7 @@ export function GatewayProvider({ children }: { children: React.ReactNode }) {
8181 const listenersRef = useRef < Map < string , Set < EventCallback > > > ( new Map ( ) )
8282 const reconnectTimerRef = useRef < ReturnType < typeof setTimeout > | null > ( null )
8383 const reconnectAttemptRef = useRef ( 0 )
84- const credentialsRef = useRef < { url : string ; password : string } | null > ( null )
84+ const credentialsRef = useRef < { url : string ; credential : string } | null > ( null )
8585 const intentionalDisconnectRef = useRef ( false )
8686 const deviceIdentityRef = useRef < DeviceIdentity | null > ( null )
8787 const connectedRef = useRef ( false )
@@ -114,7 +114,7 @@ export function GatewayProvider({ children }: { children: React.ReactNode }) {
114114
115115 // Core connect logic
116116 const doConnect = useCallback (
117- ( url : string , password : string ) => {
117+ ( url : string , credential : string ) => {
118118 cleanup ( )
119119 intentionalDisconnectRef . current = false
120120 setError ( null )
@@ -185,7 +185,7 @@ export function GatewayProvider({ children }: { children: React.ReactNode }) {
185185 const signature = await signPayload ( identity . privateKey , authPayload )
186186
187187 connectReq = makeConnectRequest (
188- password ,
188+ credential ,
189189 {
190190 id : identity . deviceId ,
191191 publicKey : identity . publicKeyBase64Url ,
@@ -197,7 +197,7 @@ export function GatewayProvider({ children }: { children: React.ReactNode }) {
197197 )
198198 } else {
199199 // First connection: token-only, no device block
200- connectReq = makeConnectRequest ( password )
200+ connectReq = makeConnectRequest ( credential )
201201 }
202202
203203 ws . send ( JSON . stringify ( connectReq ) )
@@ -274,7 +274,7 @@ export function GatewayProvider({ children }: { children: React.ReactNode }) {
274274 const shouldRemember = localStorage . getItem ( STORAGE_REMEMBER ) !== 'false'
275275 if ( shouldRemember ) {
276276 localStorage . setItem ( STORAGE_URL , url )
277- localStorage . setItem ( STORAGE_PASS , password )
277+ localStorage . setItem ( STORAGE_PASS , credential )
278278 }
279279 } catch { }
280280 return
@@ -348,7 +348,7 @@ export function GatewayProvider({ children }: { children: React.ReactNode }) {
348348 const delay = Math . min ( 1000 * Math . pow ( 2 , attempt - 1 ) , 30000 )
349349 reconnectTimerRef . current = setTimeout ( ( ) => {
350350 if ( credentialsRef . current ) {
351- doConnect ( credentialsRef . current . url , credentialsRef . current . password )
351+ doConnect ( credentialsRef . current . url , credentialsRef . current . credential )
352352 }
353353 } , delay )
354354 }
@@ -359,12 +359,12 @@ export function GatewayProvider({ children }: { children: React.ReactNode }) {
359359
360360 // Public connect
361361 const connect = useCallback (
362- ( url : string , password : string ) => {
363- credentialsRef . current = { url, password }
362+ ( url : string , credential : string ) => {
363+ credentialsRef . current = { url, credential }
364364 setGatewayUrl ( url )
365365 reconnectAttemptRef . current = 0
366366 connectedRef . current = false
367- doConnect ( url , password )
367+ doConnect ( url , credential )
368368 } ,
369369 [ doConnect ] ,
370370 )
@@ -392,14 +392,14 @@ export function GatewayProvider({ children }: { children: React.ReactNode }) {
392392 if ( creds ) {
393393 cleanup ( )
394394 reconnectAttemptRef . current = 0
395- doConnect ( creds . url , creds . password )
395+ doConnect ( creds . url , creds . credential )
396396 return
397397 }
398398 try {
399399 const url = localStorage . getItem ( STORAGE_URL )
400400 const pass = localStorage . getItem ( STORAGE_PASS )
401401 if ( url && pass ) {
402- credentialsRef . current = { url, password : pass }
402+ credentialsRef . current = { url, credential : pass }
403403 setGatewayUrl ( url )
404404 cleanup ( )
405405 doConnect ( url , pass )
@@ -469,7 +469,7 @@ export function GatewayProvider({ children }: { children: React.ReactNode }) {
469469 const url = localStorage . getItem ( STORAGE_URL )
470470 const pass = localStorage . getItem ( STORAGE_PASS )
471471 if ( url && pass ) {
472- credentialsRef . current = { url, password : pass }
472+ credentialsRef . current = { url, credential : pass }
473473 setGatewayUrl ( url )
474474 doConnect ( url , pass )
475475 return
@@ -479,7 +479,7 @@ export function GatewayProvider({ children }: { children: React.ReactNode }) {
479479 // 2. On desktop (Tauri), read gateway config directly from ~/.openclaw/openclaw.json
480480 if ( isTauri ( ) ) {
481481 try {
482- const config = await tauriInvoke < { url : string ; password : string } > (
482+ const config = await tauriInvoke < { url : string ; credential : string } > (
483483 'engine_gateway_config' ,
484484 { } ,
485485 )
@@ -489,13 +489,13 @@ export function GatewayProvider({ children }: { children: React.ReactNode }) {
489489 const status = await tauriInvoke < { running : boolean } > ( 'engine_status' , { } )
490490 if ( cancelled ) return
491491
492- if ( status ?. running && config . url && config . password ) {
493- credentialsRef . current = { url : config . url , password : config . password }
492+ if ( status ?. running && config . url && config . credential ) {
493+ credentialsRef . current = { url : config . url , credential : config . credential }
494494 setGatewayUrl ( config . url )
495495 // Save to localStorage so future reconnects are instant
496496 localStorage . setItem ( STORAGE_URL , config . url )
497- localStorage . setItem ( STORAGE_PASS , config . password )
498- doConnect ( config . url , config . password )
497+ localStorage . setItem ( STORAGE_PASS , config . credential )
498+ doConnect ( config . url , config . credential )
499499 return
500500 }
501501 } catch {
@@ -512,7 +512,7 @@ export function GatewayProvider({ children }: { children: React.ReactNode }) {
512512 } ) . catch ( ( ) => null )
513513 if ( cancelled ) return
514514 if ( probe && probe . ok ) {
515- credentialsRef . current = { url : localUrl , password : '' }
515+ credentialsRef . current = { url : localUrl , credential : '' }
516516 setGatewayUrl ( localUrl )
517517 localStorage . setItem ( STORAGE_URL , localUrl )
518518 localStorage . setItem ( STORAGE_PASS , '' )
0 commit comments