src/app is my directory structure
src/app/login,
src/app/dashboard
so i moved middleware.js to /src directory and app/login directory
But i wanted to have different login for front end and backend
but new directory structure its not working
/src/app/dashboard
/src/app/dashboard/login
with
http://localhost:3000/dashboard/login?callbackUrl=http%3A%2F%2Flocalhost%3A3000%2Fdashboard%2Flogin
Not worth . Auth is null because middleware.js not called.
so i copied middlewar.js in every directory and wanted to see if it work.
Nope. So i need to know how to fix this.
middleware.js
import NextAuth from "next-auth";
import { authConfig } from "@/lib/auth/authconfig";
export default NextAuth(authConfig).auth;
export const config = {
matcher: ['/((?!api|static|.*\\..*|_next).*)'],
};