Skip to content

Commit

Permalink
fix(facade): passthrough authorization
Browse files Browse the repository at this point in the history
  • Loading branch information
Vilsol committed Oct 2, 2024
1 parent 916a34b commit ad218e5
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion packages/facade/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,11 @@ export class RestoreCommerceFacade<TModules extends FacadeModuleBase[] = []> imp
if (url !== 'local') {
return new RemoteGraphQLDataSource({
url,
// TODO willSendRequest
willSendRequest({ request, context }): Promise<void> | void {
if (context && context['authorization']) {
request.http.headers.set('authorization', context['authorization']);
}
},
});
} else {
const schema = this.apolloServices[name]?.schema;
Expand Down

0 comments on commit ad218e5

Please sign in to comment.