File tree Expand file tree Collapse file tree 1 file changed +10
-2
lines changed
apps/dashboard/src/app/(dashboard)/(bridge) Expand file tree Collapse file tree 1 file changed +10
-2
lines changed Original file line number Diff line number Diff line change 11import "server-only" ;
22
3- import { BRIDGE_URL , DASHBOARD_THIRDWEB_CLIENT_ID } from "@/constants/env" ;
3+ import { BRIDGE_URL , DASHBOARD_THIRDWEB_SECRET_KEY } from "@/constants/env" ;
4+ import { getAuthToken } from "app/api/lib/getAuthToken" ;
45import type { Address } from "thirdweb" ;
56import type { Route } from "./types/route" ;
67
@@ -38,8 +39,15 @@ export async function getRoutes({
3839 if ( destinationTokenAddress ) {
3940 url . searchParams . set ( "destinationTokenAddress" , destinationTokenAddress ) ;
4041 }
42+ const token = await getAuthToken ( ) ;
4143 const routesResponse = await fetch ( url , {
42- headers : { "x-client-id" : DASHBOARD_THIRDWEB_CLIENT_ID } ,
44+ headers : token
45+ ? {
46+ authorization : `Bearer ${ token } ` ,
47+ }
48+ : {
49+ "x-secret-key" : DASHBOARD_THIRDWEB_SECRET_KEY ,
50+ } ,
4351 next : { revalidate : 60 * 60 } ,
4452 } ) ;
4553
You can’t perform that action at this time.
0 commit comments