Middleware not working
Unanswered
Northeast Congo Lion posted this in #help-forum
Northeast Congo LionOP
middleware.ts file not working.
I check in server console for "middleware running for" not showing in terminal
I check in server console for "middleware running for" not showing in terminal
import { withAuth } from "next-auth/middleware";
export default withAuth({
callbacks: {
authorized: ({ req, token }) => {
console.log('middleware running for:', req.url)
if (token) {
return true;
}
return false;
},
},
pages: {
signIn: "/",
error: "/error",
},
});
export const config = {
matcher: [
"/dashboard/:path*",
],
};1 Reply
Northeast Congo LionOP