Skip to content

Commit

Permalink
fix(facade): multiple authorization header locations
Browse files Browse the repository at this point in the history
  • Loading branch information
Vilsol committed Oct 9, 2024
1 parent efc5444 commit c70576b
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions packages/facade/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -234,8 +234,10 @@ export class RestoreCommerceFacade<TModules extends FacadeModuleBase[] = []> imp
return new RemoteGraphQLDataSource({
url,
willSendRequest({ request, context }): Promise<void> | void {
if (context && context['authorization']) {
request.http.headers.set('authorization', context['authorization']);
if (context?.authorization) {
request.http.headers.set('authorization', context.authorization);
} else if (context?.request?.header?.authorization) {
request.http.headers.set('authorization', context.request.header.authorization);
}
},
});
Expand Down

0 comments on commit c70576b

Please sign in to comment.