+
Redirecting to sign-in...
+ {/* Or redirect to PublicHome if sign-in is not immediate / user needs to click again */}
+ {/* For now, this message is fine as signIn() should overlay Google prompt */}
+
+ );
+};
+
// Added debug component to show authentication state
function AuthDebug({ user, loading }: { user: any, loading: boolean }) {
return (
@@ -135,4 +170,4 @@ export default function App() {
);
-}
+}
\ No newline at end of file
diff --git a/client/src/pages/PublicHome.tsx b/client/src/pages/PublicHome.tsx
index 658b5c9..f68aaac 100644
--- a/client/src/pages/PublicHome.tsx
+++ b/client/src/pages/PublicHome.tsx
@@ -1,6 +1,7 @@
// client/src/pages/PublicHome.tsx
import React, { useState, useEffect, useMemo } from 'react';
-import { Link } from 'wouter'; // Or your routing library
+import { Link } from 'wouter';
+import { useAuthContext } from '@/contexts/AuthContext'; // Added
import SnippetGrid from '@/components/SnippetGrid'; // Adjust path as needed
import { Input } from '@/components/ui/input'; // Adjust path for your UI components
import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from '@/components/ui/select'; // Adjust path
@@ -11,6 +12,7 @@ import Layout from '@/components/Layout'; // Adjust path for Layout component
const ALL_ITEMS_VALUE = "_ALL_"; // Define placeholder for "All" options
const PublicHome: React.FC = () => {
+ const { signIn } = useAuthContext(); // Added
const [snippets, setSnippets] = useState