diff --git a/src/lib/auth-bridge.ts b/src/lib/auth-bridge.ts index a315b11..07958a2 100644 --- a/src/lib/auth-bridge.ts +++ b/src/lib/auth-bridge.ts @@ -95,24 +95,18 @@ class AuthBridge { private handleLoginResponse(success: boolean) { if (success) { + this.loginRequested = false; + if (this.syncFromStorage()) { - this.loginRequested = false; this.markReady(this.token); return; } - window.setTimeout(() => { - if (this.syncFromStorage()) { - this.loginRequested = false; - this.markReady(this.token); - return; - } - - console.warn("⚠️ Flutter login response arrived before token"); - this.loginRequested = false; - this.resolvePending(null); - this.markReady(null); - }, 50); + console.warn( + "⚠️ Flutter login succeeded, but token is not available yet. Set cookie before emitting success.", + ); + this.resolvePending(null); + this.markReady(null); return; }