From 65ac4293ec3b425d327d929b74a42bece4d4b4ca Mon Sep 17 00:00:00 2001 From: Kevin He Date: Wed, 10 May 2023 08:50:20 -0700 Subject: [PATCH] Fix missing commerce-sdk-react logout call (#1180) * add logout call * void not awaited promise --- packages/commerce-sdk-react/src/auth/index.ts | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/packages/commerce-sdk-react/src/auth/index.ts b/packages/commerce-sdk-react/src/auth/index.ts index e440a36153..2f5b4b6998 100644 --- a/packages/commerce-sdk-react/src/auth/index.ts +++ b/packages/commerce-sdk-react/src/auth/index.ts @@ -421,8 +421,11 @@ class Auth { * */ async logout() { - // TODO: are we missing a call to /logout? - // Ticket: https://gus.lightning.force.com/lightning/r/ADM_Work__c/a07EE00001EFF4nYAH/view + // Not awaiting on purpose because there isn't much we can do if this fails. + void helpers.logout(this.client, { + accessToken: this.get('access_token'), + refreshToken: this.get('refresh_token_registered') + }) this.clearStorage() return this.loginGuestUser() }