mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-17 10:02:05 +00:00
feat(Linear Node): Add support for OAuth2 (#7201)
This commit is contained in:
@@ -23,6 +23,7 @@ export async function linearApiRequest(
|
||||
option: IDataObject = {},
|
||||
): Promise<any> {
|
||||
const endpoint = 'https://api.linear.app/graphql';
|
||||
const authenticationMethod = this.getNodeParameter('authentication', 0, 'apiToken') as string;
|
||||
|
||||
let options: OptionsWithUri = {
|
||||
headers: {
|
||||
@@ -35,7 +36,11 @@ export async function linearApiRequest(
|
||||
};
|
||||
options = Object.assign({}, options, option);
|
||||
try {
|
||||
return await this.helpers.requestWithAuthentication.call(this, 'linearApi', options);
|
||||
return await this.helpers.requestWithAuthentication.call(
|
||||
this,
|
||||
authenticationMethod === 'apiToken' ? 'linearApi' : 'linearOAuth2Api',
|
||||
options,
|
||||
);
|
||||
} catch (error) {
|
||||
throw new NodeApiError(this.getNode(), error as JsonObject);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user