Revert "fix: Always use IP address for webhooks"

This reverts commit 880865f1f2.
This commit is contained in:
Andras Bacsai
2022-04-29 23:25:15 +02:00
parent 45c904e876
commit e93d97f2bc
6 changed files with 16 additions and 39 deletions

View File

@@ -11,7 +11,6 @@
import { toast } from '@zerodevx/svelte-toast';
import { t } from '$lib/translations';
import { getIP } from '$lib/components/common';
const { id } = $page.params;
let url = browser ? (settings.fqdn ? settings.fqdn : window.location.origin) : '';
@@ -27,8 +26,7 @@
appSecret: null
};
}
onMount(async () => {
url = await getIP();
onMount(() => {
oauthIdEl && oauthIdEl.focus();
});

View File

@@ -30,21 +30,21 @@
<script>
import { dev } from '$app/env';
import { getDomain, dashify, getIP } from '$lib/components/common';
import { getDomain, dashify } from '$lib/components/common';
import { t } from '$lib/translations';
export let source;
export let settings;
onMount(async () => {
onMount(() => {
const { organization, id, htmlUrl } = source;
const { fqdn } = settings;
const ip = await getIP();
let host = `http://${ip}`;
if (fqdn && fqdn.startsWith('https')) {
host = `https://${ip}`;
}
console.log(ip, host);
const host = dev
? 'http://localhost:3000'
: fqdn
? fqdn
: `http://${window.location.host}` || '';
const domain = getDomain(fqdn);
let url = 'settings/apps/new';
if (organization) url = `organizations/${organization}/settings/apps/new`;
const name = dashify(domain) || 'app';