     } else {
        localStorage.setItem("flutter-web-auth-2", window.location.href);
        window.close();
      }
    } catch (e) {
      console.error("Error in postMessage:", e);

      try {
        localStorage.setItem("flutter-web-auth-2", window.location.href);
      } catch (storageError) {
        console.error("localStorage fallback failed:", storageError);
      }
    }
  }

  document.addEventListener("DOMContentLoaded", () => {
    console.log("Document loaded, executing postAuthentication