Skip to content

Commit

Permalink
Merge pull request #49 from tsd2024/develop
Browse files Browse the repository at this point in the history
feat: revert middleware change
  • Loading branch information
jakub-mrow authored Jun 5, 2024
2 parents 8aef9b9 + c86203d commit c029647
Showing 1 changed file with 1 addition and 16 deletions.
17 changes: 1 addition & 16 deletions src/middleware.ts
Original file line number Diff line number Diff line change
@@ -1,18 +1,3 @@
import { NextRequest, NextResponse } from 'next/server';

export default async function middleware(req: NextRequest) {
const path = req.nextUrl.pathname;
const session = !!req.cookies.get("next-auth.session-token")

if (!session) {
return NextResponse.redirect(new URL(`/api/auth/signin?callbackUrl=${path}`, req.url));
}
return NextResponse.next();
}
export { default } from "next-auth/middleware"

export const config = { matcher: ["/dashboard", "/create-room", "/rooms/:path*", "/join"] }

// export { default } from "next-auth/middleware"

// export const config = { matcher: ["/dashboard", "/create-room", "/rooms/:path*", "/join"] }

0 comments on commit c029647

Please sign in to comment.