File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff 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" , {
Original file line number Diff line number Diff line change @@ -6,13 +6,7 @@ export const proxy = async (request: NextRequest) =>
66
77export 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} ;
You can’t perform that action at this time.
0 commit comments