Skip to content

Commit

Permalink
don't always blcok
Browse files Browse the repository at this point in the history
  • Loading branch information
juliusmarminge committed Jan 9, 2025
1 parent 11c7aed commit ce28ebf
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions playground/middleware.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/* eslint-disable @typescript-eslint/no-unused-vars */
import {
MiddlewareConfig,
NextResponse,
Expand All @@ -8,10 +9,11 @@ import { getSession } from "./lib/data";

export default (async (req) => {
if (req.nextUrl.pathname !== "/") {
const sesh = await getSession();
if (!sesh) {
return NextResponse.json({ error: "Forbidden" }, { status: 403 });
}
// TOGGLE TO MAKE CALLBACK NOT REACH
// const sesh = await getSession();
// if (!sesh) {
// return NextResponse.json({ error: "Forbidden" }, { status: 403 });
// }
}

return NextResponse.next();
Expand Down

0 comments on commit ce28ebf

Please sign in to comment.