Skip to content

Commit 31579dc

Browse files
committed
Comment out isvalidtoken check for docker to run properly
1 parent 9574769 commit 31579dc

File tree

1 file changed

+13
-12
lines changed

1 file changed

+13
-12
lines changed

apps/frontend/src/middleware.ts

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
import { NextURL } from 'next/dist/server/web/next-url';
2-
import { type NextRequest, NextResponse } from 'next/server';
1+
import { NextURL } from "next/dist/server/web/next-url";
2+
import { type NextRequest, NextResponse } from "next/server";
33

44
const PUBLIC_ROUTES = ["/login", "/register"];
55

@@ -18,29 +18,30 @@ async function isValidToken(TOKEN: string): Promise<boolean> {
1818
}
1919

2020
export default async function middleware(request: NextRequest) {
21-
const REDIRECT_TO_LOGIN = NextResponse.redirect(new NextURL("/login", request.url));
21+
const REDIRECT_TO_LOGIN = NextResponse.redirect(
22+
new NextURL("/login", request.url)
23+
);
2224
const TOKEN = request.cookies.get("TOKEN");
2325
if (TOKEN == undefined) {
2426
return REDIRECT_TO_LOGIN;
2527
}
26-
27-
if (!await isValidToken(TOKEN.value)) {
28-
REDIRECT_TO_LOGIN.cookies.delete("TOKEN");
29-
return REDIRECT_TO_LOGIN;
30-
}
28+
29+
// if (!await isValidToken(TOKEN.value)) {
30+
// REDIRECT_TO_LOGIN.cookies.delete("TOKEN");
31+
// return REDIRECT_TO_LOGIN;
32+
// }
3133

3234
return NextResponse.next();
33-
3435
}
3536

3637
export const config = {
37-
matcher: "/((?!api|_next/static|_next/image|favicon.ico|sitemap.xml|robots.txt|login|register).*)",
38+
matcher:
39+
"/((?!api|_next/static|_next/image|favicon.ico|sitemap.xml|robots.txt|login|register).*)",
3840
// matcher: [
3941
// "/matching",
4042
// "/",
4143
// "/profile",
4244
// "/question",
4345
// "/question/.*",
4446
// ],
45-
}
46-
47+
};

0 commit comments

Comments
 (0)