Any updates on NextJS App Router Middleware issue when using Prisma? #11339
Unanswered
1Ghasthunter1
asked this question in
Help
Replies: 1 comment
-
I'm unsure if this approach is acceptable. I believe we can continue using cookies until next-auth supports Prisma. import { MiddlewareConfig } from 'next/server';
import { withAuth } from 'next-auth/middleware';
export default withAuth(
function middleware(req) {
console.log('🚀 ~ middleware ~ req:', req);
},
{
callbacks: {
authorized({ req }) {
if (req.cookies.get('next-auth.csrf-token')) return true;
return false;
},
},
},
);
export const config: MiddlewareConfig = {
matcher: ['/dashboard/:path*'],
}; |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
First off, AuthJS has come such a long way since 6 months ago.
Just seeing if anyone here has found any work-arounds for getting Prisma Provider to work with middleware. My setup
Beta Was this translation helpful? Give feedback.
All reactions