mirror of
https://github.com/LukeHagar/better-auth.git
synced 2025-12-10 04:19:32 +00:00
chore: add allow docs flag
This commit is contained in:
@@ -2,7 +2,7 @@ import { NextRequest, NextResponse } from "next/server";
|
|||||||
|
|
||||||
export default function middleware(req: NextRequest) {
|
export default function middleware(req: NextRequest) {
|
||||||
if (
|
if (
|
||||||
req.nextUrl.pathname.startsWith("/docs") &&
|
req.nextUrl.pathname.startsWith("/docs") && !req.nextUrl.searchParams.has("allow_docs") &&
|
||||||
process.env.NODE_ENV === "production"
|
process.env.NODE_ENV === "production"
|
||||||
) {
|
) {
|
||||||
return NextResponse.redirect(new URL("/", req.url));
|
return NextResponse.redirect(new URL("/", req.url));
|
||||||
|
|||||||
Reference in New Issue
Block a user