Merged PR 1090: middleware removal

middleware removal

Related work items: #10511
This commit is contained in:
Robert Bond
2024-03-01 18:04:44 +00:00
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*",
],
};
+37
View File
@@ -0,0 +1,37 @@
// 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*",
// ],
// };