mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-22 12:19:09 +00:00
⚡ Do not overwrite all oauth data on reconnect #PROD-24
This commit is contained in:
@@ -1032,7 +1032,15 @@ class App {
|
|||||||
return ResponseHelper.sendErrorResponse(res, errorResponse);
|
return ResponseHelper.sendErrorResponse(res, errorResponse);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (savedCredentialsData.oauthTokenData) {
|
||||||
|
// Only overwrite supplied data as some providers do for example just return the
|
||||||
|
// refresh_token on the very first request and not on subsequent ones.
|
||||||
|
Object.assign(savedCredentialsData.oauthTokenData, oauthToken.data);
|
||||||
|
} else {
|
||||||
|
// No data exists so simply set
|
||||||
savedCredentialsData.oauthTokenData = oauthToken.data;
|
savedCredentialsData.oauthTokenData = oauthToken.data;
|
||||||
|
}
|
||||||
|
|
||||||
_.unset(savedCredentialsData, 'csrfSecret');
|
_.unset(savedCredentialsData, 'csrfSecret');
|
||||||
|
|
||||||
credentials.setData(savedCredentialsData, encryptionKey);
|
credentials.setData(savedCredentialsData, encryptionKey);
|
||||||
|
|||||||
Reference in New Issue
Block a user