Merge pull request #7335 from RoadieHQ/custom-redirect-url-github-provider

Add ability to override github app callback url
This commit is contained in:
Patrik Oldsberg
2021-09-29 13:39:52 +02:00
committed by GitHub
3 changed files with 13 additions and 1 deletions
@@ -223,6 +223,7 @@ export const createGithubProvider = (
const enterpriseInstanceUrl = envConfig.getOptionalString(
'enterpriseInstanceUrl',
);
const customCallbackUrl = envConfig.getOptionalString('callbackUrl');
const authorizationUrl = enterpriseInstanceUrl
? `${enterpriseInstanceUrl}/login/oauth/authorize`
: undefined;
@@ -232,7 +233,9 @@ export const createGithubProvider = (
const userProfileUrl = enterpriseInstanceUrl
? `${enterpriseInstanceUrl}/api/v3/user`
: undefined;
const callbackUrl = `${globalConfig.baseUrl}/${providerId}/handler/frame`;
const callbackUrl =
customCallbackUrl ||
`${globalConfig.baseUrl}/${providerId}/handler/frame`;
const catalogIdentityClient = new CatalogIdentityClient({
catalogApi,