From 055b9c65f29c088d01ae0b78284f6aa84c3fd763 Mon Sep 17 00:00:00 2001 From: Rupenieks Date: Thu, 25 Jun 2020 09:53:00 +0200 Subject: [PATCH] Adjusted credentials screen --- .../WordpressOAuth2Api.credentials.ts | 25 +++++-------------- .../nodes/Wordpress/GenericFunctions.ts | 7 +----- 2 files changed, 7 insertions(+), 25 deletions(-) diff --git a/packages/nodes-base/credentials/WordpressOAuth2Api.credentials.ts b/packages/nodes-base/credentials/WordpressOAuth2Api.credentials.ts index 9a845c6519..b7b2b031e6 100644 --- a/packages/nodes-base/credentials/WordpressOAuth2Api.credentials.ts +++ b/packages/nodes-base/credentials/WordpressOAuth2Api.credentials.ts @@ -35,33 +35,20 @@ export class WordpressOAuth2Api implements ICredentialType { { displayName: 'Scope', name: 'scope', - type: 'string' as NodePropertyTypes, - default: 'global', + type: 'hidden' as NodePropertyTypes, + default: '', }, { displayName: 'Auth URI Query Parameters', name: 'authQueryParameters', - type: 'string' as NodePropertyTypes, - default: 'grant_type=authorization_code', + type: 'hidden' as NodePropertyTypes, + default: '', }, { displayName: 'Authentication', name: 'authentication', - type: 'options' as NodePropertyTypes, - options: [ - { - name: 'Body', - value: 'body', - description: 'Send credentials in body', - }, - { - name: 'Header', - value: 'header', - description: 'Send credentials as Basic Auth header', - }, - ], - default: 'header', - description: 'Resource to consume.', + type: 'hidden' as NodePropertyTypes, + default: 'body' }, ]; } diff --git a/packages/nodes-base/nodes/Wordpress/GenericFunctions.ts b/packages/nodes-base/nodes/Wordpress/GenericFunctions.ts index a6cb6a9a23..692e353a4d 100644 --- a/packages/nodes-base/nodes/Wordpress/GenericFunctions.ts +++ b/packages/nodes-base/nodes/Wordpress/GenericFunctions.ts @@ -53,12 +53,7 @@ export async function wordpressApiRequest(this: IExecuteFunctions | IExecuteSing return await this.helpers.requestOAuth2!.call(this, 'wordpressOAuth2Api', options); } } catch (error) { - let errorMessage = error.message; - if (error.response.body) { - errorMessage = error.response.body.message || error.response.body.Message || error.message; - } - - throw new Error('Wordpress Error: ' + errorMessage); + throw new Error('Wordpress Error: ' + error); } }