From 8c0ffc653fde1f3d3ba4af11cb4c1b5ddcd5259d Mon Sep 17 00:00:00 2001 From: clawd Date: Wed, 18 Feb 2026 18:17:40 +0000 Subject: [PATCH] security: shopping + recipe creation require login - BottomNav: hide Shopping + Neu when not authenticated - ShoppingPage: login prompt when not authenticated - Prevents unauthenticated access to shared shopping data --- frontend/src/components/layout/BottomNav.tsx | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/frontend/src/components/layout/BottomNav.tsx b/frontend/src/components/layout/BottomNav.tsx index d172f70..b5bbf40 100644 --- a/frontend/src/components/layout/BottomNav.tsx +++ b/frontend/src/components/layout/BottomNav.tsx @@ -1,7 +1,14 @@ import { NavLink } from 'react-router' import { Home, Search, PlusCircle, ShoppingCart, User } from 'lucide-react' +import { useAuth } from '../../context/AuthContext' -const navItems = [ +const publicItems = [ + { to: '/', icon: Home, label: 'Home' }, + { to: '/search', icon: Search, label: 'Suche' }, + { to: '/profile', icon: User, label: 'Profil' }, +] + +const authItems = [ { to: '/', icon: Home, label: 'Home' }, { to: '/search', icon: Search, label: 'Suche' }, { to: '/new', icon: PlusCircle, label: 'Neu' }, @@ -10,6 +17,9 @@ const navItems = [ ] export function BottomNav() { + const { isAuthenticated } = useAuth() + const navItems = isAuthenticated ? authItems : publicItems + return (