From 297458e6e800bd69897619ed94d8ec3962863126 Mon Sep 17 00:00:00 2001 From: Olivier Corradi Date: Tue, 6 Oct 2020 13:46:33 +0200 Subject: [PATCH] Fix OAuth for Linky --- integrations/authentication/OAuth2Manager.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/integrations/authentication/OAuth2Manager.js b/integrations/authentication/OAuth2Manager.js index da30fe14..e70a3c99 100644 --- a/integrations/authentication/OAuth2Manager.js +++ b/integrations/authentication/OAuth2Manager.js @@ -96,8 +96,11 @@ export default class { client_id: this.clientId, code: authorizationCode, grant_type: 'authorization_code', - scope: this.scope, }; + // The Linky API doesn't provide a scope and fails if it is added with value `undefined` + if (this.scope) { + formData.scope = this.scope; + } if (!omitRedirectUri) { formData.redirect_uri = getCallbackUrl();