diff --git a/apps/browser-extension/entrypoints/popup/App.tsx b/apps/browser-extension/entrypoints/popup/App.tsx index f61a2415d..498a75a2c 100644 --- a/apps/browser-extension/entrypoints/popup/App.tsx +++ b/apps/browser-extension/entrypoints/popup/App.tsx @@ -845,11 +845,11 @@ function App() {
{authInvalidated ? (
-
-

+
+

Session Expired

-

+

Logged out since authentication was invalidated. Please login again.

@@ -857,18 +857,18 @@ function App() {
) : (
-

- Login to unlock all chrome extension features +

+ Login to unlock all Chrome extension features

    -
  • +
  • Save any page to your supermemory
  • -
  • +
  • Import all your Twitter / X Bookmarks
  • -
  • +
  • Import your ChatGPT Memories
@@ -876,10 +876,10 @@ function App() { )}
-

+

Having trouble logging in?{" "}

) : isPending ? ( -
- -
+ ) : showNovaEmptyState ? ( {isLoadingMore && ( -
- +
+
)}
diff --git a/packages/lib/auth-context.tsx b/packages/lib/auth-context.tsx index 45ffc5b4b..cfb9b9ab7 100644 --- a/packages/lib/auth-context.tsx +++ b/packages/lib/auth-context.tsx @@ -24,6 +24,7 @@ interface AuthContextType { org: Organization | null organizations: OrganizationListItem[] | null isRestoring: boolean + isSessionPending: boolean setActiveOrg: (orgSlug: string) => Promise updateOrgMetadata: (partial: Record) => void refetchOrganizations: () => Promise @@ -32,7 +33,7 @@ interface AuthContextType { const AuthContext = createContext(undefined) export function AuthProvider({ children }: { children: ReactNode }) { - const { data: session } = useSession() + const { data: session, isPending: isSessionPending } = useSession() const [org, setOrg] = useState(null) const [isRestoring, setIsRestoring] = useState(true) const { @@ -73,6 +74,10 @@ export function AuthProvider({ children }: { children: ReactNode }) { }, []) useEffect(() => { + if (isSessionPending) { + return + } + if (!session?.session) { setIsRestoring(false) setOrg(null) @@ -145,7 +150,7 @@ export function AuthProvider({ children }: { children: ReactNode }) { return () => { cancelled = true } - }, [session, orgsData, orgsPending, setActiveOrg]) + }, [session, isSessionPending, orgsData, orgsPending, setActiveOrg]) useEffect(() => { if (typeof window === "undefined") return @@ -181,6 +186,7 @@ export function AuthProvider({ children }: { children: ReactNode }) { org, organizations, isRestoring, + isSessionPending, session: session?.session ?? null, user: session?.user ?? null, setActiveOrg,