Middleware protected routes

This commit is contained in:
Brad Traversy
2024-07-10 10:45:02 -04:00
parent 74ea4baed8
commit 5417ba807d
2 changed files with 25 additions and 16 deletions
+20 -16
View File
@@ -93,14 +93,16 @@ const Navbar = () => {
>
Properties
</Link>
<Link
href='/properties/add'
className={`${
pathname === '/properties/add' ? 'bg-black' : ''
} text-white hover:bg-gray-900 hover:text-white rounded-md px-3 py-2`}
>
Add Property
</Link>
{session && (
<Link
href='/properties/add'
className={`${
pathname === '/properties/add' ? 'bg-black' : ''
} text-white hover:bg-gray-900 hover:text-white rounded-md px-3 py-2`}
>
Add Property
</Link>
)}
</div>
</div>
</div>
@@ -250,14 +252,16 @@ const Navbar = () => {
>
Properties
</Link>
<Link
href='/properties/add'
className={`${
pathname === '/properties/add' ? 'bg-black' : ''
} text-white block rounded-md px-3 py-2 text-base font-medium`}
>
Add Property
</Link>
{session && (
<Link
href='/properties/add'
className={`${
pathname === '/properties/add' ? 'bg-black' : ''
} text-white block rounded-md px-3 py-2 text-base font-medium`}
>
Add Property
</Link>
)}
{!session && (
<div className='block md:ml-6'>
<div className='flex items-center'>