mirror of
https://github.com/n8n-io/n8n.git
synced 2024-11-14 00:24:07 -08:00
Adjusted credentials screen
This commit is contained in:
parent
d8842838f5
commit
055b9c65f2
|
@ -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'
|
||||
},
|
||||
];
|
||||
}
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue