tantk commited on
Commit
4d15eef
·
verified ·
1 Parent(s): 4ac478a

fix: createAuthHeaders return shape

Browse files
Files changed (1) hide show
  1. server.js +6 -3
server.js CHANGED
@@ -101,9 +101,12 @@ app.use(
101
  new HTTPFacilitatorClient({
102
  url: FACILITATOR_URL,
103
  ...(FACILITATOR_API_KEY && {
104
- createAuthHeaders: async () => ({
105
- headers: { Authorization: `Bearer ${FACILITATOR_API_KEY}` },
106
- }),
 
 
 
107
  }),
108
  }),
109
  [{ network: NETWORK, server: new ExactStellarScheme() }],
 
101
  new HTTPFacilitatorClient({
102
  url: FACILITATOR_URL,
103
  ...(FACILITATOR_API_KEY && {
104
+ // The lib calls this for each operation ("verify"/"settle"/"supported")
105
+ // and indexes into the returned object by op name.
106
+ createAuthHeaders: async () => {
107
+ const auth = { Authorization: `Bearer ${FACILITATOR_API_KEY}` };
108
+ return { verify: auth, settle: auth, supported: auth };
109
+ },
110
  }),
111
  }),
112
  [{ network: NETWORK, server: new ExactStellarScheme() }],