mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-20 11:22:15 +00:00
fix(core): Fix for Google and Microsoft generic OAuth2 credentials
This commit is contained in:
@@ -93,10 +93,12 @@ oauth2CredentialController.get(
|
|||||||
|
|
||||||
// At some point in the past we saved hidden scopes to credentials (but shouldn't)
|
// At some point in the past we saved hidden scopes to credentials (but shouldn't)
|
||||||
// Delete scope before applying defaults to make sure new scopes are present on reconnect
|
// Delete scope before applying defaults to make sure new scopes are present on reconnect
|
||||||
|
// Generic Oauth2 API is an exception because it needs to save the scope
|
||||||
|
const genericOAuth2 = ['oAuth2Api', 'googleOAuth2Api', 'microsoftOAuth2Api'];
|
||||||
if (
|
if (
|
||||||
decryptedDataOriginal?.scope &&
|
decryptedDataOriginal?.scope &&
|
||||||
credentialType.includes('OAuth2') &&
|
credentialType.includes('OAuth2') &&
|
||||||
!['oAuth2Api'].includes(credentialType)
|
!genericOAuth2.includes(credentialType)
|
||||||
) {
|
) {
|
||||||
delete decryptedDataOriginal.scope;
|
delete decryptedDataOriginal.scope;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user