payload-authjs
Version:
A Payload CMS 3 plugin for Auth.js 5
21 lines (20 loc) • 699 B
JavaScript
import { NextRequest, NextResponse } from "next/server";
/**
* Middleware of payload-authjs
*
* @deprecated This middleware is no longer needed and will be removed in the future
*/ export default function middleware(// eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/no-redundant-type-constituents
arg) {
// Inline middleware
if (arg instanceof NextRequest) {
return NextResponse.next();
}
// Middleware wrapper
if (typeof arg === "function") {
return (req)=>{
return arg(req) ?? NextResponse.next();
};
}
throw new Error("Invalid argument for middleware");
}
//# sourceMappingURL=middleware.js.map