Skip to content

Commit

Permalink
fix the issue with creating oauth urls
Browse files Browse the repository at this point in the history
  • Loading branch information
netroy committed Nov 29, 2022
1 parent f22de6f commit c4d0790
Showing 1 changed file with 19 additions and 11 deletions.
30 changes: 19 additions & 11 deletions packages/cli/src/CredentialsHelper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,23 @@ import { CredentialsOverwrites } from '@/CredentialsOverwrites';
import { whereClause } from './UserManagement/UserManagementHelper';
import { RESPONSE_ERROR_MESSAGES } from './constants';

const mockNodesData: INodeTypeData = {};
const mockNode = {
name: '',
typeVersion: 1,
type: 'mock',
position: [0, 0],
parameters: {} as INodeParameters,
} as INode;

const mockNodesData: INodeTypeData = {
mock: {
sourcePath: '',
type: {
description: { properties: [] as INodeProperties[] },
} as INodeType,
},
};

const mockNodeTypes: INodeTypes = {
getByName(nodeType: string): INodeType | IVersionedNodeType {
return mockNodesData[nodeType]?.type;
Expand Down Expand Up @@ -395,24 +411,16 @@ export class CredentialsHelper extends ICredentialsHelper {
throw e;
}
} else {
const node = {
name: '',
typeVersion: 1,
type: 'mock',
position: [0, 0],
parameters: {} as INodeParameters,
} as INode;

const workflow = new Workflow({
nodes: [node],
nodes: [mockNode],
connections: {},
active: false,
nodeTypes: mockNodeTypes,
});

// Resolve expressions if any are set
decryptedData = workflow.expression.getComplexParameterValue(
node,
mockNode,
decryptedData as INodeParameters,
mode,
defaultTimezone,
Expand Down

0 comments on commit c4d0790

Please sign in to comment.