chore(dashboard,db): prepping for migration time
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
import { clerkMiddleware, createRouteMatcher } from '@clerk/nextjs/server';
|
||||
import { NextResponse } from 'next/server';
|
||||
|
||||
// This example protects all routes including api/trpc routes
|
||||
// Please edit this to allow other routes to be public as needed.
|
||||
@@ -13,6 +14,9 @@ const isPublicRoute = createRouteMatcher([
|
||||
|
||||
export default clerkMiddleware(
|
||||
(auth, req) => {
|
||||
if (!process.env.MAINTENANCE_MODE && !req.url.includes('/maintenance')) {
|
||||
return NextResponse.redirect(new URL('/maintenance', req.url), 307);
|
||||
}
|
||||
if (!isPublicRoute(req)) {
|
||||
auth().protect();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user