feat(routing): permanent redirect /artists/amari-rodriguez -> /artists/amari-kyss via middleware (308)

This commit is contained in:
Nicholai 2025-10-20 20:56:10 -06:00
parent a8aac83f32
commit d8650a7822

View File

@ -7,6 +7,13 @@ export default withAuth(
const token = req.nextauth.token
const { pathname } = req.nextUrl
// Permanent redirect for renamed artist slug
if (pathname === "/artists/amari-rodriguez") {
const url = new URL("/artists/amari-kyss", req.url)
const res = NextResponse.redirect(url, 308)
return res
}
// Allow token-based bypass for admin migrate endpoint (non-interactive deployments)
const migrateToken = process.env.MIGRATE_TOKEN
const headerToken = req.headers.get("x-migrate-token")