From 8cc6ea7b47d6058d33dd1c71ab63b87198dd3b53 Mon Sep 17 00:00:00 2001 From: Zoey Lan Date: Tue, 9 Jan 2024 15:52:11 -0700 Subject: [PATCH] Use the actual error string from body --- .../strategies/__tests__/token-exchange/authenticate.test.ts | 4 ++-- .../server/authenticate/admin/strategies/token-exchange.ts | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/shopify-app-remix/src/server/authenticate/admin/strategies/__tests__/token-exchange/authenticate.test.ts b/packages/shopify-app-remix/src/server/authenticate/admin/strategies/__tests__/token-exchange/authenticate.test.ts index 563288e299..4b4a3711d8 100644 --- a/packages/shopify-app-remix/src/server/authenticate/admin/strategies/__tests__/token-exchange/authenticate.test.ts +++ b/packages/shopify-app-remix/src/server/authenticate/admin/strategies/__tests__/token-exchange/authenticate.test.ts @@ -123,7 +123,7 @@ describe('authenticate', () => { const shopify = shopifyApp(config); const {token} = getJwt(); - await mockInvalidTokenExchangeRequest('invalid_subject_token'); + await mockInvalidTokenExchangeRequest('invalid_subject_token_type'); // WHEN const response = await getThrownResponse( @@ -154,7 +154,7 @@ describe('authenticate', () => { const shopify = shopifyApp(config); const {token} = getJwt(); - await mockInvalidTokenExchangeRequest('invalid_subject_token'); + await mockInvalidTokenExchangeRequest('invalid_subject_token_type'); // WHEN const response = await getThrownResponse( diff --git a/packages/shopify-app-remix/src/server/authenticate/admin/strategies/token-exchange.ts b/packages/shopify-app-remix/src/server/authenticate/admin/strategies/token-exchange.ts index 0d3909d1cc..b9928b8ddc 100644 --- a/packages/shopify-app-remix/src/server/authenticate/admin/strategies/token-exchange.ts +++ b/packages/shopify-app-remix/src/server/authenticate/admin/strategies/token-exchange.ts @@ -126,7 +126,7 @@ export class TokenExchangeStrategy error instanceof InvalidJwtError || (error instanceof HttpResponseError && error.response.code === 400 && - error.response.body?.error === 'invalid_subject_token') + error.response.body?.error === 'invalid_subject_token_type') ) { throw respondToInvalidSessionToken({ params: {api, config, logger},