mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-19 11:01:15 +00:00
⚡ Get OAuth-Callback URLs from backend
This commit is contained in:
@@ -399,6 +399,10 @@ export interface IN8nUISettings {
|
||||
timezone: string;
|
||||
executionTimeout: number;
|
||||
maxExecutionTimeout: number;
|
||||
oauthCallbackUrls: {
|
||||
oauth1: string;
|
||||
oauth2: string;
|
||||
};
|
||||
urlBaseWebhook: string;
|
||||
versionCli: string;
|
||||
}
|
||||
|
||||
@@ -235,7 +235,7 @@ export default mixins(
|
||||
oAuthCallbackUrl (): string {
|
||||
const types = this.parentTypes(this.credentialTypeData.name);
|
||||
const oauthType = (this.credentialTypeData.name === 'oAuth2Api' || types.includes('oAuth2Api')) ? 'oauth2' : 'oauth1';
|
||||
return this.$store.getters.getWebhookBaseUrl + `rest/${oauthType}-credential/callback`;
|
||||
return this.$store.getters.oauthCallbackUrls[oauthType];
|
||||
},
|
||||
requiredPropertiesFilled (): boolean {
|
||||
for (const property of this.credentialProperties) {
|
||||
|
||||
@@ -8,6 +8,7 @@ import {
|
||||
IConnection,
|
||||
IConnections,
|
||||
ICredentialType,
|
||||
IDataObject,
|
||||
INodeConnections,
|
||||
INodeIssueData,
|
||||
INodeTypeDescription,
|
||||
@@ -55,6 +56,7 @@ export const store = new Vuex.Store({
|
||||
executionTimeout: -1,
|
||||
maxExecutionTimeout: Number.MAX_SAFE_INTEGER,
|
||||
versionCli: '0.0.0',
|
||||
oauthCallbackUrls: {},
|
||||
workflowExecutionData: null as IExecutionResponse | null,
|
||||
lastSelectedNode: null as string | null,
|
||||
lastSelectedNodeOutputIndex: null as number | null,
|
||||
@@ -490,6 +492,9 @@ export const store = new Vuex.Store({
|
||||
setVersionCli (state, version: string) {
|
||||
Vue.set(state, 'versionCli', version);
|
||||
},
|
||||
setOauthCallbackUrls(state, urls: IDataObject) {
|
||||
Vue.set(state, 'oauthCallbackUrls', urls);
|
||||
},
|
||||
|
||||
addNodeType (state, typeData: INodeTypeDescription) {
|
||||
if (!typeData.hasOwnProperty('name')) {
|
||||
@@ -609,6 +614,9 @@ export const store = new Vuex.Store({
|
||||
versionCli: (state): string => {
|
||||
return state.versionCli;
|
||||
},
|
||||
oauthCallbackUrls: (state): object => {
|
||||
return state.oauthCallbackUrls;
|
||||
},
|
||||
|
||||
// Push Connection
|
||||
pushConnectionActive: (state): boolean => {
|
||||
|
||||
@@ -1873,6 +1873,7 @@ export default mixins(
|
||||
this.$store.commit('setExecutionTimeout', settings.executionTimeout);
|
||||
this.$store.commit('setMaxExecutionTimeout', settings.maxExecutionTimeout);
|
||||
this.$store.commit('setVersionCli', settings.versionCli);
|
||||
this.$store.commit('setOauthCallbackUrls', settings.oauthCallbackUrls);
|
||||
},
|
||||
async loadNodeTypes (): Promise<void> {
|
||||
const nodeTypes = await this.restApi().getNodeTypes();
|
||||
|
||||
Reference in New Issue
Block a user