Skip to content

Commit

Permalink
not sure why the issue is persisting the way it is. continuing to try…
Browse files Browse the repository at this point in the history
… and debug
  • Loading branch information
siddheshraze committed Feb 27, 2025
1 parent 0c6983f commit cfcd0b4
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion frontend/middleware.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,11 @@ import authConfig from './auth.config';
const { auth: nextAuthMiddleware } = NextAuth(authConfig);

export default auth(async function middleware(request: NextRequest) {
const session = await nextAuthMiddleware(); // Fetch session once
const { pathname } = request.nextUrl;
if (pathname.includes('/api/customsignin')) return NextResponse.next();

const url = request.nextUrl.clone();
const session = await nextAuthMiddleware(); // Fetch session once

const isAuthenticated = !!session;
const isProtectedRoute = ['/dashboard', '/measurementshub', '/fixeddatainput'].some(route => url.pathname.startsWith(route));
Expand Down

0 comments on commit cfcd0b4

Please sign in to comment.