fix: correct github oauth2 callback url (#9052)

* fix: correct github oauth2 callback url
This commit is contained in:
Steven Masley
2023-08-11 09:25:05 -05:00
committed by GitHub
parent 47ca84be47
commit 320de18be7
2 changed files with 11 additions and 1 deletions
@@ -136,6 +136,7 @@ test("change login type to OIDC", async () => {
jest.spyOn(SSO, "redirectToOIDCAuth").mockImplementation(() => {
// Does a noop
return ""
})
const ssoSection = screen.getByTestId("sso-section")
@@ -30,7 +30,16 @@ export const redirectToOIDCAuth = (
stateString: string,
redirectTo: string,
) => {
window.location.href = `/api/v2/users/${toType}/callback?oidc_merge_state=${stateString}&redirect=${redirectTo}`
switch (toType) {
case "github":
window.location.href = `/api/v2/users/oauth2/github/callback?oidc_merge_state=${stateString}&redirect=${redirectTo}`
break
case "oidc":
window.location.href = `/api/v2/users/oidc/callback?oidc_merge_state=${stateString}&redirect=${redirectTo}`
break
default:
throw new Error(`Unknown login type ${toType}`)
}
}
export const useSingleSignOnSection = () => {