feat: refine admin workflows and deployment packaging
This commit is contained in:
@@ -28,6 +28,11 @@ function shouldUseSimplifiedChinese(request: NextRequest) {
|
||||
|
||||
export default function middleware(request: NextRequest) {
|
||||
const { pathname, search } = request.nextUrl
|
||||
|
||||
if (pathname === '/admin/forgot' || pathname.startsWith('/admin/forgot/')) {
|
||||
return new NextResponse(null, { status: 404 })
|
||||
}
|
||||
|
||||
const hasLocalePrefix = locales.some(
|
||||
(locale) => pathname === `/${locale}` || pathname.startsWith(`/${locale}/`),
|
||||
)
|
||||
@@ -45,6 +50,7 @@ export default function middleware(request: NextRequest) {
|
||||
|
||||
export const config = {
|
||||
matcher: [
|
||||
'/admin/forgot/:path*',
|
||||
// Skip all internal paths (_next, _vercel, api, admin, payload assets, static files)
|
||||
'/((?!api|admin|_next|_vercel|favicon\\.ico|robots\\.txt|sitemap.*|Products|Product|.*\\..*).*)',
|
||||
],
|
||||
|
||||
Reference in New Issue
Block a user