Middleware protected routes
This commit is contained in:
@@ -93,6 +93,7 @@ const Navbar = () => {
|
|||||||
>
|
>
|
||||||
Properties
|
Properties
|
||||||
</Link>
|
</Link>
|
||||||
|
{session && (
|
||||||
<Link
|
<Link
|
||||||
href='/properties/add'
|
href='/properties/add'
|
||||||
className={`${
|
className={`${
|
||||||
@@ -101,6 +102,7 @@ const Navbar = () => {
|
|||||||
>
|
>
|
||||||
Add Property
|
Add Property
|
||||||
</Link>
|
</Link>
|
||||||
|
)}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -250,6 +252,7 @@ const Navbar = () => {
|
|||||||
>
|
>
|
||||||
Properties
|
Properties
|
||||||
</Link>
|
</Link>
|
||||||
|
{session && (
|
||||||
<Link
|
<Link
|
||||||
href='/properties/add'
|
href='/properties/add'
|
||||||
className={`${
|
className={`${
|
||||||
@@ -258,6 +261,7 @@ const Navbar = () => {
|
|||||||
>
|
>
|
||||||
Add Property
|
Add Property
|
||||||
</Link>
|
</Link>
|
||||||
|
)}
|
||||||
{!session && (
|
{!session && (
|
||||||
<div className='block md:ml-6'>
|
<div className='block md:ml-6'>
|
||||||
<div className='flex items-center'>
|
<div className='flex items-center'>
|
||||||
|
|||||||
@@ -0,0 +1,5 @@
|
|||||||
|
export { default } from 'next-auth/middleware';
|
||||||
|
|
||||||
|
export const config = {
|
||||||
|
matcher: ['/properties/add', '/profile', '/properties/saved', '/messages'],
|
||||||
|
};
|
||||||
Reference in New Issue
Block a user