fix(core): OAuth2 scope saved to DB fix

This commit is contained in:
Michael Kret 2022-12-01 15:08:02 +02:00 committed by GitHub
parent 59771c80ea
commit 7cb5dc2aa5
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -89,6 +89,12 @@ oauth2CredentialController.get(
true,
);
// 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
if (decryptedDataOriginal?.scope) {
delete decryptedDataOriginal.scope;
}
const oauthCredentials = credentialsHelper.applyDefaultsAndOverwrites(
decryptedDataOriginal,
(credential as unknown as ICredentialsEncrypted).type,