Netlify Authentication - Hide nave items when unauthenticated

Hi all -

Happy New Year!!

Super newbie question - I have netlify identity up and running. Logging in and logging out is is working like a charm :grin: How do I hide specific nav bar items from unauthenticated users? For instance, I only want “Dashboard” to appear for authenticated users.

Thanks so much. Everyone has been so helpful with my newbie q’s! I appreciate it.

-Connor

Happy New Year @CRR! Does this help?

It shows how to use hasRole to protect <NavLink>s (or any other elements)

@CRR Hi.

In the same cookbook that @Tobbe referenced you case see that the useAuth hook also has isAuthenticated that checked is the user is logged in or not:

https://redwoodjs.com/cookbook/role-based-access-control-rbac#how-to-protect-markup-in-a-page