parent
357ebafa16
commit
82808e81f2
1 changed files with 18 additions and 0 deletions
|
@ -1,6 +1,7 @@
|
||||||
import AuthenticationExecutionInfoRepresentation from "@keycloak/keycloak-admin-client/lib/defs/authenticationExecutionInfoRepresentation";
|
import AuthenticationExecutionInfoRepresentation from "@keycloak/keycloak-admin-client/lib/defs/authenticationExecutionInfoRepresentation";
|
||||||
import AuthenticationFlowRepresentation from "@keycloak/keycloak-admin-client/lib/defs/authenticationFlowRepresentation";
|
import AuthenticationFlowRepresentation from "@keycloak/keycloak-admin-client/lib/defs/authenticationFlowRepresentation";
|
||||||
import type { AuthenticationProviderRepresentation } from "@keycloak/keycloak-admin-client/lib/defs/authenticatorConfigRepresentation";
|
import type { AuthenticationProviderRepresentation } from "@keycloak/keycloak-admin-client/lib/defs/authenticatorConfigRepresentation";
|
||||||
|
import AuthenticatorConfigRepresentation from "@keycloak/keycloak-admin-client/lib/defs/authenticatorConfigRepresentation";
|
||||||
import {
|
import {
|
||||||
AlertVariant,
|
AlertVariant,
|
||||||
Button,
|
Button,
|
||||||
|
@ -103,12 +104,29 @@ export default function FlowDetails() {
|
||||||
try {
|
try {
|
||||||
let id = ex.id!;
|
let id = ex.id!;
|
||||||
if ("parent" in change) {
|
if ("parent" in change) {
|
||||||
|
let config: AuthenticatorConfigRepresentation = {};
|
||||||
|
if ("authenticationConfig" in ex) {
|
||||||
|
config = await adminClient.authenticationManagement.getConfig({
|
||||||
|
id: ex.authenticationConfig as string,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
await adminClient.authenticationManagement.delExecution({ id });
|
await adminClient.authenticationManagement.delExecution({ id });
|
||||||
const result =
|
const result =
|
||||||
await adminClient.authenticationManagement.addExecutionToFlow({
|
await adminClient.authenticationManagement.addExecutionToFlow({
|
||||||
flow: change.parent?.displayName! || flow?.alias!,
|
flow: change.parent?.displayName! || flow?.alias!,
|
||||||
provider: ex.providerId!,
|
provider: ex.providerId!,
|
||||||
});
|
});
|
||||||
|
|
||||||
|
if (config.id) {
|
||||||
|
const newConfig = {
|
||||||
|
id: result.id,
|
||||||
|
alias: config.alias,
|
||||||
|
config: config.config,
|
||||||
|
};
|
||||||
|
await adminClient.authenticationManagement.createConfig(newConfig);
|
||||||
|
}
|
||||||
|
|
||||||
id = result.id!;
|
id = result.id!;
|
||||||
}
|
}
|
||||||
const times = change.newIndex - change.oldIndex;
|
const times = change.newIndex - change.oldIndex;
|
||||||
|
|
Loading…
Reference in a new issue