mirror of
https://github.com/n8n-io/n8n.git
synced 2025-03-05 20:50:17 -08:00
fix(core): Fix for Google and Microsoft generic OAuth2 credentials
This commit is contained in:
parent
ac066fc9f3
commit
efa4c56757
|
@ -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;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue