|
@@ -1,9 +1,18 @@
|
|
|
-import { withAuth } from "@kinde-oss/kinde-auth-nextjs/server";
|
|
|
|
|
|
|
+import { withAuth } from "@kinde-oss/kinde-auth-nextjs/middleware";
|
|
|
|
|
|
|
|
-export default function middleware(request: Request) {
|
|
|
|
|
- return withAuth(request);
|
|
|
|
|
-}
|
|
|
|
|
|
|
+export default withAuth(
|
|
|
|
|
+ async function middleware() {
|
|
|
|
|
+ },
|
|
|
|
|
+ {
|
|
|
|
|
+ isReturnToCurrentPage: true,
|
|
|
|
|
+ // Middleware still runs on all routes, but doesn't protect the blog route
|
|
|
|
|
+ publicPaths: ["/"],
|
|
|
|
|
+ }
|
|
|
|
|
+);
|
|
|
|
|
|
|
|
export const config = {
|
|
export const config = {
|
|
|
- matcher: ["/files/:path*", "/api-docs/:path*", "/api/:path*", "/reference/:path*"],
|
|
|
|
|
|
|
+ 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)).*)',
|
|
|
|
|
+ ],
|
|
|
};
|
|
};
|