fix: fix web build

This commit is contained in:
master 2024-12-30 06:52:15 +08:00
parent a4c549e7c3
commit 4c6cc1116b
2 changed files with 30 additions and 25 deletions

View File

@ -1,5 +1,5 @@
import { blog } from '@konobangu/cms'; import { blog } from '@konobangu/cms';
import { Feed } from '@konobangu/cms/components/feed'; // import { Feed } from '@konobangu/cms/components/feed';
import { Button } from '@konobangu/design-system/components/ui/button'; import { Button } from '@konobangu/design-system/components/ui/button';
import { env } from '@konobangu/env'; import { env } from '@konobangu/env';
import { MoveRight, PhoneCall } from 'lucide-react'; import { MoveRight, PhoneCall } from 'lucide-react';
@ -14,8 +14,7 @@ export const Hero = async () => {
<div className="container mx-auto"> <div className="container mx-auto">
<div className="flex flex-col items-center justify-center gap-8 py-20 lg:py-40"> <div className="flex flex-col items-center justify-center gap-8 py-20 lg:py-40">
<div> <div>
<Feed queries={[blog.latestPostQuery]} draft={draft.isEnabled}> {/* <Feed queries={[blog.latestPostQuery]} draft={draft.isEnabled}>
{/* biome-ignore lint/suspicious/useAwait: "Server Actions must be async" */}
{async ([data]) => { {async ([data]) => {
'use server'; 'use server';
@ -32,7 +31,7 @@ export const Hero = async () => {
</Button> </Button>
); );
}} }}
</Feed> </Feed> */}
</div> </div>
<div className="flex flex-col gap-4"> <div className="flex flex-col gap-4">
<h1 className="max-w-2xl text-center font-regular text-5xl tracking-tighter md:text-7xl"> <h1 className="max-w-2xl text-center font-regular text-5xl tracking-tighter md:text-7xl">

View File

@ -6,7 +6,7 @@ import {
noseconeConfig, noseconeConfig,
noseconeMiddleware, noseconeMiddleware,
} from '@konobangu/security/middleware'; } from '@konobangu/security/middleware';
import { NextResponse } from 'next/server'; import { type NextRequest, NextResponse } from 'next/server';
export const config = { export const config = {
// matcher tells Next.js which routes to run the middleware on. This runs the // matcher tells Next.js which routes to run the middleware on. This runs the
@ -16,7 +16,8 @@ export const config = {
const securityHeaders = noseconeMiddleware(noseconeConfig); const securityHeaders = noseconeMiddleware(noseconeConfig);
export default authMiddleware(async (_auth, request) => { export const middleware = async (request: NextRequest) => {
const beforeMiddleware = async (request: NextRequest) => {
if (!env.ARCJET_KEY) { if (!env.ARCJET_KEY) {
return securityHeaders(); return securityHeaders();
} }
@ -38,4 +39,9 @@ export default authMiddleware(async (_auth, request) => {
return NextResponse.json({ error: message }, { status: 403 }); return NextResponse.json({ error: message }, { status: 403 });
} }
}); };
const response = await beforeMiddleware(request);
return authMiddleware(response as any);
};