Middleware protected routes
This commit is contained in:
@@ -93,6 +93,7 @@ const Navbar = () => {
|
||||
>
|
||||
Properties
|
||||
</Link>
|
||||
{session && (
|
||||
<Link
|
||||
href='/properties/add'
|
||||
className={`${
|
||||
@@ -101,6 +102,7 @@ const Navbar = () => {
|
||||
>
|
||||
Add Property
|
||||
</Link>
|
||||
)}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -250,6 +252,7 @@ const Navbar = () => {
|
||||
>
|
||||
Properties
|
||||
</Link>
|
||||
{session && (
|
||||
<Link
|
||||
href='/properties/add'
|
||||
className={`${
|
||||
@@ -258,6 +261,7 @@ const Navbar = () => {
|
||||
>
|
||||
Add Property
|
||||
</Link>
|
||||
)}
|
||||
{!session && (
|
||||
<div className='block md:ml-6'>
|
||||
<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