|
|
|
@ -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; |
|
|
|
} |
|
|
|
|
|
|
|
|