Browse Source

fix: streamline login response handling and improve token availability warning

master
mortezaei 2 months ago
parent
commit
53b8bf53ec
  1. 12
      src/lib/auth-bridge.ts

12
src/lib/auth-bridge.ts

@ -95,24 +95,18 @@ class AuthBridge {
private handleLoginResponse(success: boolean) {
if (success) {
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;
console.warn(
"⚠️ Flutter login succeeded, but token is not available yet. Set cookie before emitting success.",
);
this.resolvePending(null);
this.markReady(null);
}, 50);
return;
}

Loading…
Cancel
Save