-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmiddleware.ts
31 lines (29 loc) · 886 Bytes
/
middleware.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
import { withAuth } from '@kinde-oss/kinde-auth-nextjs/middleware';
export default withAuth(
async function middleware(req: any) {
// console.log('Middleware called');
// TODO: Add a logic check to verify if the user has completed onboarding, if not we redirect them to the onboarding page. To complete onboarding, the user must have a username.
},
{
isReturnToCurrentPage: true,
loginPage: '/login',
publicPaths: [
'/register',
'/login',
'/about-us',
'/learn',
'/api/auth/register',
'/api/auth/login',
'/api/users/',
'/',
'/blog/*',
'/api/uploadthing',
],
},
);
export const config = {
matcher: [
// Run on everything but Next internals and static files
'/((?!_next|[^?]*\\.(?:html?|css|js(?!on)|jpe?g|webp|png|gif|svg|ttf|woff2?|ico|csv|docx?|xlsx?|zip|webmanifest)).*)',
],
};