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 1
1
import "server-only" ;
2
2
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" ;
4
5
import type { Address } from "thirdweb" ;
5
6
import type { Route } from "./types/route" ;
6
7
@@ -38,8 +39,15 @@ export async function getRoutes({
38
39
if ( destinationTokenAddress ) {
39
40
url . searchParams . set ( "destinationTokenAddress" , destinationTokenAddress ) ;
40
41
}
42
+ const token = await getAuthToken ( ) ;
41
43
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
+ } ,
43
51
next : { revalidate : 60 * 60 } ,
44
52
} ) ;
45
53
You can’t perform that action at this time.
0 commit comments