|
|
@ -2,7 +2,6 @@ import { getClientCookie } from "./cookies"; |
|
|
|
|
|
|
|
|
const TOKEN_COOKIE_NAME = "HABIB_TOKEN"; |
|
|
const TOKEN_COOKIE_NAME = "HABIB_TOKEN"; |
|
|
const COINS_COOKIE_NAME = "HABIB_COINS"; |
|
|
const COINS_COOKIE_NAME = "HABIB_COINS"; |
|
|
const LOGIN_TIMEOUT_MS = 30_000; |
|
|
|
|
|
|
|
|
|
|
|
function postFlutterMessage(payload: Record<string, unknown>) { |
|
|
function postFlutterMessage(payload: Record<string, unknown>) { |
|
|
if (typeof window === "undefined") { |
|
|
if (typeof window === "undefined") { |
|
|
@ -136,14 +135,6 @@ class AuthBridge { |
|
|
return false; |
|
|
return false; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
window.setTimeout(() => { |
|
|
|
|
|
if (!this.token) { |
|
|
|
|
|
console.warn("⚠️ Flutter login timeout"); |
|
|
|
|
|
this.loginRequested = false; |
|
|
|
|
|
this.resolvePending(null); |
|
|
|
|
|
} |
|
|
|
|
|
}, LOGIN_TIMEOUT_MS); |
|
|
|
|
|
|
|
|
|
|
|
return true; |
|
|
return true; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|