Skip to content

#1 PDF Application on GitHub that lets you edit PDFs on any device anywhere

387 B
Raw Blame
import { useSyncExternalStore } from "react";
import {
  getPortalSaasSessionState,
  subscribePortalSaasSession,
} from "@editor/portal/auth/portalSaasSession";

/** Reactive browser authorization, independent of the instance's link status. */
export function usePortalSaasSession() {
  return useSyncExternalStore(
    subscribePortalSaasSession,
    getPortalSaasSessionState,
  );
}