mirror of
https://github.com/logos-co/logos-web.git
synced 2026-08-27 12:11:14 +00:00
17 lines
407 B
TypeScript
17 lines
407 B
TypeScript
import { NextResponse, type NextRequest } from 'next/server'
|
|
|
|
import { stripAdminNotFoundParam } from './src/lib/admin-url'
|
|
|
|
export const middleware = (request: NextRequest): NextResponse => {
|
|
const cleanUrl = stripAdminNotFoundParam(request.nextUrl)
|
|
if (cleanUrl) {
|
|
return NextResponse.redirect(cleanUrl)
|
|
}
|
|
|
|
return NextResponse.next()
|
|
}
|
|
|
|
export const config = {
|
|
matcher: ['/admin/:path*'],
|
|
}
|