Skip to content

Commit 38045c8

Browse files
committed
Address comments
1 parent bbed89c commit 38045c8

2 files changed

Lines changed: 7 additions & 8 deletions

File tree

apps/website/app/(home)/auth/token/route.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,11 @@ export const GET = async (request: NextRequest): Promise<NextResponse> => {
99
try {
1010
if (typeof token !== "string") throw new Error("Please provide a token");
1111
if (typeof url !== "string") throw new Error("Please provide a single URL");
12+
if (
13+
url.indexOf("://") >= 0 &&
14+
!url.startsWith(request.nextUrl.origin + "/")
15+
)
16+
throw new Error("Absolute URLs should be within the application");
1217

1318
const client = await createClient();
1419
const result = await client.rpc("get_secret_token", {

apps/website/proxy.ts

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,7 @@ export const proxy = async (request: NextRequest) =>
66

77
export const config = {
88
matcher: [
9-
/*
10-
* Match all request paths except for the ones starting with:
11-
* - _next/static (static files)
12-
* - _next/image (image optimization files)
13-
* - favicon.ico (favicon file)
14-
* Feel free to modify this pattern to include more paths.
15-
*/
16-
"/((?!_next/static|_next/image|favicon.ico|docs|blog|nextra|.*\\.(?:svg|png|jpg|jpeg|gif|webp)$).*)",
9+
/* Only apply to /auth paths */
10+
"/(auth/.*)",
1711
],
1812
};

0 commit comments

Comments
 (0)