mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-17 18:12:04 +00:00
fix(core): Fix oauth2 client credentials not always working (#5327)
fix oauth client credentials not working as expected
This commit is contained in:
committed by
GitHub
parent
59f290fe85
commit
ec7575b032
@@ -1029,7 +1029,10 @@ export async function requestOAuth2(
|
||||
let oauthTokenData = credentials.oauthTokenData as clientOAuth2.Data;
|
||||
|
||||
// if it's the first time using the credentials, get the access token and save it into the DB.
|
||||
if (credentials.grantType === OAuth2GrantType.clientCredentials && oauthTokenData === undefined) {
|
||||
if (
|
||||
credentials.grantType === OAuth2GrantType.clientCredentials &&
|
||||
(oauthTokenData === undefined || Object.keys(oauthTokenData).length === 0)
|
||||
) {
|
||||
const { data } = await getClientCredentialsToken(oAuthClient, credentials);
|
||||
|
||||
// Find the credentials
|
||||
|
||||
Reference in New Issue
Block a user