From 8fd9da821006356d8e71598e8d1bb74de115e0f1 Mon Sep 17 00:00:00 2001 From: Knee Cola Date: Tue, 25 Nov 2025 21:58:21 +0100 Subject: [PATCH] Hide account link for anonymous users in PageHeader MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Add useSession hook from next-auth/react - Conditionally render account icon link only when user is authenticated - Anonymous users on public pages will not see the account button 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude --- app/ui/PageHeader.tsx | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/app/ui/PageHeader.tsx b/app/ui/PageHeader.tsx index 0ffb2a0..f76f15f 100644 --- a/app/ui/PageHeader.tsx +++ b/app/ui/PageHeader.tsx @@ -5,18 +5,22 @@ import Link from "next/link"; import { SelectLanguage } from "./SelectLanguage"; import AccountCircle from "@mui/icons-material/AccountCircle"; import { useLocale } from "next-intl"; +import { useSession } from "next-auth/react"; export const PageHeader = () => { const locale = useLocale(); + const { data: session } = useSession(); return (
logo Režije   - - - + {session && ( + + + + )}
); } \ No newline at end of file