Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Properly handle provider host name when using http(s) prefix when adding a new integration #7831

Merged
merged 3 commits into from
Feb 28, 2022
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 11 additions & 2 deletions components/dashboard/src/settings/Integrations.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -547,8 +547,17 @@ export function GitIntegrationModal(props: ({

const updateHostValue = (host: string) => {
if (mode === "new") {
setHost(host);
setRedirectURL(callbackUrl(host));

let verifiedHost = host;
AlexTugarev marked this conversation as resolved.
Show resolved Hide resolved

if (host.startsWith("https://")) {
verifiedHost = host.replace("https://","");
} else if (host.startsWith("http://")) {
AlexTugarev marked this conversation as resolved.
Show resolved Hide resolved
verifiedHost = host.replace("http://","");
}

setHost(verifiedHost);
setRedirectURL(callbackUrl(verifiedHost));
setErrorMessage(undefined);
}
}
Expand Down