fix(core): Ensure OAuth token data is not stubbed in source control (#10302)

This commit is contained in:
Iván Ovejero
2024-08-06 10:56:02 +02:00
committed by GitHub
parent e3edeaa035
commit 98115e95df
4 changed files with 102 additions and 3 deletions

View File

@@ -1342,7 +1342,9 @@ export async function requestOAuth2(
// if it's the first time using the credentials, get the access token and save it into the DB.
if (
credentials.grantType === 'clientCredentials' &&
(oauthTokenData === undefined || Object.keys(oauthTokenData).length === 0)
(oauthTokenData === undefined ||
Object.keys(oauthTokenData).length === 0 ||
oauthTokenData.access_token === '') // stub
) {
const { data } = await oAuthClient.credentials.getToken();
// Find the credentials