chore(dashboard,db): prepping for migration time

This commit is contained in:
Carl-Gerhard Lindesvärd
2024-11-28 20:58:18 +01:00
parent 9ffa213fc2
commit ab8bce7752
5 changed files with 56 additions and 7 deletions

View File

@@ -0,0 +1,18 @@
import { CalendarCogIcon } from 'lucide-react';
export default function Maintenance() {
return (
<div className="h-screen w-full center-center overflow-hidden">
<div className="relative z-10 col gap-2 center-center">
<CalendarCogIcon className="size-32 mb-4 animate-wiggle text-def-300" />
<div className="text-[150px] font-mono font-bold -mb-16 leading-[1] select-none pointer-events-none whitespace-nowrap bg-gradient-to-b from-def-300 to-def-100 bg-clip-text text-transparent">
Oh no!
</div>
<h1 className="text-6xl font-bold">Maintenance</h1>
<p className="text-xl text-muted-foreground">
We&apos;re doing a planned maintenance. Please check back later.
</p>
</div>
</div>
);
}

View File

@@ -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();
}