From a51024e9152fdbffd5a406146594521085735a21 Mon Sep 17 00:00:00 2001 From: Hariom Balhara Date: Tue, 30 Apr 2024 20:35:00 +0530 Subject: [PATCH] hotfix-conditional-valid-resource-owner-check (#14814) --- packages/app-store/_utils/oauth/OAuthManager.ts | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/packages/app-store/_utils/oauth/OAuthManager.ts b/packages/app-store/_utils/oauth/OAuthManager.ts index ea653dac4a..e863a6b94a 100644 --- a/packages/app-store/_utils/oauth/OAuthManager.ts +++ b/packages/app-store/_utils/oauth/OAuthManager.ts @@ -174,7 +174,6 @@ export class OAuthManager { */ isTokenExpired?: IsTokenExpired; }) { - ensureValidResourceOwner(resourceOwner); this.resourceOwner = resourceOwner; this.currentTokenObject = currentTokenObject; this.appSlug = appSlug; @@ -191,6 +190,13 @@ export class OAuthManager { credentialSyncVariables.CREDENTIAL_SYNC_SECRET_HEADER_NAME && credentialSyncVariables.CREDENTIAL_SYNC_SECRET ); + + if (this.useCredentialSync) { + // Though it should be validated without credential sync as well but it seems like we have some credentials without userId in production + // So, we are not validating it for now + ensureValidResourceOwner(resourceOwner); + } + this.autoCheckTokenExpiryOnRequest = autoCheckTokenExpiryOnRequest; this.updateTokenObject = updateTokenObject; }