mirror of
https://github.com/zitadel/zitadel.git
synced 2025-12-12 10:15:04 +00:00
nexturl
This commit is contained in:
@@ -139,16 +139,12 @@ export async function GET(request: NextRequest) {
|
|||||||
const matched = IDP_SCOPE_REGEX.exec(idpScope);
|
const matched = IDP_SCOPE_REGEX.exec(idpScope);
|
||||||
idpId = matched?.[1] ?? "";
|
idpId = matched?.[1] ?? "";
|
||||||
|
|
||||||
console.log("idpId", idpId, organization ? organization : undefined);
|
|
||||||
|
|
||||||
const identityProviders = await getActiveIdentityProviders(
|
const identityProviders = await getActiveIdentityProviders(
|
||||||
organization ? organization : undefined,
|
organization ? organization : undefined,
|
||||||
).then((resp) => {
|
).then((resp) => {
|
||||||
return resp.identityProviders;
|
return resp.identityProviders;
|
||||||
});
|
});
|
||||||
|
|
||||||
console.log("idps", JSON.stringify(identityProviders));
|
|
||||||
|
|
||||||
const idp = identityProviders.find((idp) => idp.id === idpId);
|
const idp = identityProviders.find((idp) => idp.id === idpId);
|
||||||
|
|
||||||
if (idp) {
|
if (idp) {
|
||||||
@@ -177,10 +173,6 @@ export async function GET(request: NextRequest) {
|
|||||||
params.set("organization", organization);
|
params.set("organization", organization);
|
||||||
}
|
}
|
||||||
|
|
||||||
console.log(
|
|
||||||
`${host}/idp/${provider}/success?` + new URLSearchParams(params),
|
|
||||||
);
|
|
||||||
|
|
||||||
return startIdentityProviderFlow({
|
return startIdentityProviderFlow({
|
||||||
idpId,
|
idpId,
|
||||||
urls: {
|
urls: {
|
||||||
@@ -191,10 +183,12 @@ export async function GET(request: NextRequest) {
|
|||||||
`${host}/idp/${provider}/failure?` +
|
`${host}/idp/${provider}/failure?` +
|
||||||
new URLSearchParams(params),
|
new URLSearchParams(params),
|
||||||
},
|
},
|
||||||
}).then((resp: any) => {
|
}).then((resp) => {
|
||||||
console.log(resp);
|
if (
|
||||||
if (resp.authUrl) {
|
resp.nextStep.value &&
|
||||||
return NextResponse.redirect(resp.authUrl);
|
typeof resp.nextStep.value === "string"
|
||||||
|
) {
|
||||||
|
return NextResponse.redirect(resp.nextStep.value);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user