mirror of
https://github.com/n8n-io/n8n.git
synced 2024-11-10 14:44:05 -08:00
⚡ Do not overwrite all oauth data on reconnect #PROD-24
This commit is contained in:
parent
ea47e8b1bc
commit
74fac1e56c
|
@ -1032,7 +1032,15 @@ class App {
|
|||
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;
|
||||
}
|
||||
|
||||
_.unset(savedCredentialsData, 'csrfSecret');
|
||||
|
||||
credentials.setData(savedCredentialsData, encryptionKey);
|
||||
|
|
Loading…
Reference in a new issue