fix: fix web build
This commit is contained in:
parent
a4c549e7c3
commit
4c6cc1116b
@ -1,5 +1,5 @@
|
||||
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 { env } from '@konobangu/env';
|
||||
import { MoveRight, PhoneCall } from 'lucide-react';
|
||||
@ -14,8 +14,7 @@ export const Hero = async () => {
|
||||
<div className="container mx-auto">
|
||||
<div className="flex flex-col items-center justify-center gap-8 py-20 lg:py-40">
|
||||
<div>
|
||||
<Feed queries={[blog.latestPostQuery]} draft={draft.isEnabled}>
|
||||
{/* biome-ignore lint/suspicious/useAwait: "Server Actions must be async" */}
|
||||
{/* <Feed queries={[blog.latestPostQuery]} draft={draft.isEnabled}>
|
||||
{async ([data]) => {
|
||||
'use server';
|
||||
|
||||
@ -32,7 +31,7 @@ export const Hero = async () => {
|
||||
</Button>
|
||||
);
|
||||
}}
|
||||
</Feed>
|
||||
</Feed> */}
|
||||
</div>
|
||||
<div className="flex flex-col gap-4">
|
||||
<h1 className="max-w-2xl text-center font-regular text-5xl tracking-tighter md:text-7xl">
|
||||
|
@ -6,7 +6,7 @@ import {
|
||||
noseconeConfig,
|
||||
noseconeMiddleware,
|
||||
} from '@konobangu/security/middleware';
|
||||
import { NextResponse } from 'next/server';
|
||||
import { type NextRequest, NextResponse } from 'next/server';
|
||||
|
||||
export const config = {
|
||||
// matcher tells Next.js which routes to run the middleware on. This runs the
|
||||
@ -16,26 +16,32 @@ export const config = {
|
||||
|
||||
const securityHeaders = noseconeMiddleware(noseconeConfig);
|
||||
|
||||
export default authMiddleware(async (_auth, request) => {
|
||||
if (!env.ARCJET_KEY) {
|
||||
return securityHeaders();
|
||||
}
|
||||
export const middleware = async (request: NextRequest) => {
|
||||
const beforeMiddleware = async (request: NextRequest) => {
|
||||
if (!env.ARCJET_KEY) {
|
||||
return securityHeaders();
|
||||
}
|
||||
|
||||
try {
|
||||
await secure(
|
||||
[
|
||||
// See https://docs.arcjet.com/bot-protection/identifying-bots
|
||||
'CATEGORY:SEARCH_ENGINE', // Allow search engines
|
||||
'CATEGORY:PREVIEW', // Allow preview links to show OG images
|
||||
'CATEGORY:MONITOR', // Allow uptime monitoring services
|
||||
],
|
||||
request
|
||||
);
|
||||
try {
|
||||
await secure(
|
||||
[
|
||||
// See https://docs.arcjet.com/bot-protection/identifying-bots
|
||||
'CATEGORY:SEARCH_ENGINE', // Allow search engines
|
||||
'CATEGORY:PREVIEW', // Allow preview links to show OG images
|
||||
'CATEGORY:MONITOR', // Allow uptime monitoring services
|
||||
],
|
||||
request
|
||||
);
|
||||
|
||||
return securityHeaders();
|
||||
} catch (error) {
|
||||
const message = parseError(error);
|
||||
return securityHeaders();
|
||||
} catch (error) {
|
||||
const message = parseError(error);
|
||||
|
||||
return NextResponse.json({ error: message }, { status: 403 });
|
||||
}
|
||||
});
|
||||
return NextResponse.json({ error: message }, { status: 403 });
|
||||
}
|
||||
};
|
||||
|
||||
const response = await beforeMiddleware(request);
|
||||
|
||||
return authMiddleware(response as any);
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user