26 lines
450 B
TypeScript
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).*)',
|
|
],
|
|
};
|