From 1884e050ea35f69071c5247d567a6f5a37dba4a1 Mon Sep 17 00:00:00 2001 From: Joseph Date: Sat, 23 Jan 2021 21:15:30 +1100 Subject: [PATCH] Add the jwtToken support for the AWS_APPSYNC configuration --- .../src/app/services/subscriptions/providers/app-sync.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/packages/altair-app/src/app/services/subscriptions/providers/app-sync.ts b/packages/altair-app/src/app/services/subscriptions/providers/app-sync.ts index 06c0e26dd9..18f9ea8c65 100644 --- a/packages/altair-app/src/app/services/subscriptions/providers/app-sync.ts +++ b/packages/altair-app/src/app/services/subscriptions/providers/app-sync.ts @@ -15,6 +15,7 @@ export class AppSyncSubscriptionProvider extends SubscriptionProvider { "aws_appsync_region": "us-west-2", "aws_appsync_authenticationType": "API_KEY", "aws_appsync_apiKey": "..." + "aws_appsync_jwtToken" "..." } */ @@ -23,7 +24,8 @@ export class AppSyncSubscriptionProvider extends SubscriptionProvider { const region = this.connectionParams.aws_appsync_region; const auth = { type: this.connectionParams.aws_appsync_authenticationType, - apiKey: this.connectionParams.aws_appsync_apiKey, + ...this.connectionParams.aws_appsync_apiKey ? {apiKey: this.connectionParams.aws_appsync_apiKey} : {}, + ...this.connectionParams.aws_appsync_jwtToken ? { jwtToken: this.connectionParams.aws_appsync_jwtToken } : {}, }; const httpLink = createHttpLink({ uri: url });