Get OAuth-Callback URLs from backend

This commit is contained in:
Jan Oberhauser
2020-09-30 15:50:43 +02:00
parent 6f576b3da9
commit f1680386ca
6 changed files with 26 additions and 3 deletions

View File

@@ -1617,7 +1617,9 @@ class App {
// Returns the settings which are needed in the UI
this.app.get(`/${this.restEndpoint}/settings`, ResponseHelper.send(async (req: express.Request, res: express.Response): Promise<IN8nUISettings> => {
return {
const urlBaseWebhook = WebhookHelpers.getWebhookBaseUrl();
const settings: IN8nUISettings = {
endpointWebhook: this.endpointWebhook,
endpointWebhookTest: this.endpointWebhookTest,
saveDataErrorExecution: this.saveDataErrorExecution,
@@ -1626,8 +1628,12 @@ class App {
executionTimeout: this.executionTimeout,
maxExecutionTimeout: this.maxExecutionTimeout,
timezone: this.timezone,
urlBaseWebhook: WebhookHelpers.getWebhookBaseUrl(),
urlBaseWebhook,
versionCli: this.versions!.cli,
oauthCallbackUrls: {
'oauth1': urlBaseWebhook + `${this.restEndpoint}/oauth1-credential/callback`,
'oauth2': urlBaseWebhook + `${this.restEndpoint}/oauth2-credential/callback`,
}
};
}));