diff --git a/lib/src/clients/main-thread-client.ts b/lib/src/clients/main-thread-client.ts index 1a67e1b9..97c39d39 100755 --- a/lib/src/clients/main-thread-client.ts +++ b/lib/src/clients/main-thread-client.ts @@ -522,11 +522,10 @@ export const MainThreadClient = async ( const refreshAccessToken = async (): Promise => { try { await _authenticationClient.refreshAccessToken(); - await getCustomGrantConfigData().then((customGrantConfig) => { + const customGrantConfig = await getCustomGrantConfigData(); if (customGrantConfig) { - requestCustomGrant(customGrantConfig); + await requestCustomGrant(customGrantConfig); } - }); _spaHelper.refreshAccessTokenAutomatically(); return _authenticationClient.getBasicUserInfo();