mirror of
https://github.com/fosrl/pangolin.git
synced 2026-08-04 03:31:00 +02:00
dont pass orgId in generate oidc url
This commit is contained in:
@@ -26,12 +26,14 @@ type IdpLoginButtonsProps = {
|
|||||||
idps: LoginFormIDP[];
|
idps: LoginFormIDP[];
|
||||||
redirect?: string;
|
redirect?: string;
|
||||||
orgId?: string;
|
orgId?: string;
|
||||||
|
passOrgIdToOidcUrl?: boolean;
|
||||||
};
|
};
|
||||||
|
|
||||||
export default function IdpLoginButtons({
|
export default function IdpLoginButtons({
|
||||||
idps,
|
idps,
|
||||||
redirect,
|
redirect,
|
||||||
orgId
|
orgId,
|
||||||
|
passOrgIdToOidcUrl = true
|
||||||
}: IdpLoginButtonsProps) {
|
}: IdpLoginButtonsProps) {
|
||||||
const [error, setError] = useState<string | null>(null);
|
const [error, setError] = useState<string | null>(null);
|
||||||
const t = useTranslations();
|
const t = useTranslations();
|
||||||
@@ -68,12 +70,13 @@ export default function IdpLoginButtons({
|
|||||||
|
|
||||||
let redirectToUrl: string | undefined;
|
let redirectToUrl: string | undefined;
|
||||||
try {
|
try {
|
||||||
console.log("generating", idpId, redirect || "/", orgId);
|
const oidcOrgId = passOrgIdToOidcUrl ? orgId : undefined;
|
||||||
|
console.log("generating", idpId, redirect || "/", oidcOrgId);
|
||||||
const safeRedirect = cleanRedirect(redirect || "/");
|
const safeRedirect = cleanRedirect(redirect || "/");
|
||||||
const response = await generateOidcUrlProxy(
|
const response = await generateOidcUrlProxy(
|
||||||
idpId,
|
idpId,
|
||||||
safeRedirect,
|
safeRedirect,
|
||||||
orgId
|
oidcOrgId
|
||||||
);
|
);
|
||||||
|
|
||||||
if (response.error) {
|
if (response.error) {
|
||||||
|
|||||||
@@ -303,6 +303,7 @@ export default function SmartLoginForm({
|
|||||||
<IdpLoginButtons
|
<IdpLoginButtons
|
||||||
idps={[lastUsedIdp]}
|
idps={[lastUsedIdp]}
|
||||||
orgId={lastUsedIdp.orgId}
|
orgId={lastUsedIdp.orgId}
|
||||||
|
passOrgIdToOidcUrl={false}
|
||||||
redirect={redirect}
|
redirect={redirect}
|
||||||
/>
|
/>
|
||||||
)}
|
)}
|
||||||
|
|||||||
Reference in New Issue
Block a user