middleware removal

This commit is contained in:
2024-03-01 18:03:46 +00:00
parent 4824bf5d9d
commit abf280a990
2 changed files with 37 additions and 37 deletions
-37
View File
@@ -1,37 +0,0 @@
// export { default } from "next-auth/middleware";
// export const config = {
// matcher: ["/myportal/", "/myportal/:path*"],
// };
// import { withAuth } from 'next-auth/middleware';
// export default withAuth({
// pages: {
// signIn: '/login',
// },
// });
import { withAuth } from "next-auth/middleware";
export default withAuth({
callbacks: {
authorized: ({ req }) => {
// verify token and return a boolean
const sessionToken = req.cookies.get("next-auth.session-token");
if (sessionToken) return true;
else return false;
},
},
});
export const config = {
matcher: [
"/myportal",
"/myportal/:path*",
"/newappeal",
"/newappeal/:path*",
"/account",
"/account/:path*",
],
};