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

@@ -37,7 +37,6 @@
import { gitTokens } from '$lib/store';
import { browser } from '$app/env';
import { t } from '$lib/translations';
import { getIP } from '$lib/components/common';
const { id } = $page.params;
@@ -175,12 +174,11 @@
error.message === '401 Unauthorized'
) {
if (application.gitSource.gitlabAppId) {
const ip = await getIP();
let htmlUrl = application.gitSource.htmlUrl;
const left = screen.width / 2 - 1020 / 2;
const top = screen.height / 2 - 618 / 2;
const newWindow = open(
`${htmlUrl}/oauth/authorize?client_id=${application.gitSource.gitlabApp.appId}&redirect_uri=${ip}/webhooks/gitlab&response_type=code&scope=api+email+read_repository&state=${$page.params.id}`,
`${htmlUrl}/oauth/authorize?client_id=${application.gitSource.gitlabApp.appId}&redirect_uri=${window.location.origin}/webhooks/gitlab&response_type=code&scope=api+email+read_repository&state=${$page.params.id}`,
'GitLab',
'resizable=1, scrollbars=1, fullscreen=0, height=618, width=1020,top=' +
top +