fix(core): Ensure the generic OAuth2 API credential uses the OAuth2 credential test (#8941)

This commit is contained in:
Iván Ovejero
2024-03-21 13:49:34 +01:00
committed by GitHub
parent 89df277b80
commit 079a1147d4
2 changed files with 35 additions and 2 deletions

View File

@@ -84,7 +84,7 @@ export class CredentialsTester {
return 'access_token' in oauthTokenData;
}
private getCredentialTestFunction(
getCredentialTestFunction(
credentialType: string,
): ICredentialTestFunction | ICredentialTestRequestData | undefined {
// Check if test is defined on credentials
@@ -116,7 +116,8 @@ export class CredentialsTester {
for (const { name, testedBy } of nodeType.description.credentials ?? []) {
if (
name === credentialType &&
this.credentialTypes.getParentTypes(name).includes('oAuth2Api')
(this.credentialTypes.getParentTypes(name).includes('oAuth2Api') ||
name === 'oAuth2Api')
) {
return async function oauth2CredTest(
this: ICredentialTestFunctions,