link-stack/apps/leafcutter/middleware.ts
Darren Clarke b09cc82544 WIP 5
2024-03-20 17:51:21 +01:00

26 lines
450 B
TypeScript

import { withAuth } from "next-auth/middleware";
export default withAuth(
{
pages: {
signIn: `/login`,
},
callbacks: {
authorized: ({ token }) => {
// check for existence in opensearch user list
if (token?.email) {
return true;
}
return false;
},
}
}
);
export const config = {
matcher: [
'/((?!api|app|login|_next/static|_next/image|favicon.ico).*)',
],
};