[KEYCLOAK-1932] Unable to create flow named exactly the same as removed NON-top level flow
This commit is contained in:
parent
960cd8c822
commit
115663a32d
1 changed files with 8 additions and 0 deletions
|
@ -323,6 +323,14 @@ public class AuthenticationManagementResource {
|
|||
if (flow.isBuiltIn()) {
|
||||
throw new BadRequestException("Can't delete built in flow");
|
||||
}
|
||||
List<AuthenticationExecutionModel> executions = realm.getAuthenticationExecutions(id);
|
||||
for (AuthenticationExecutionModel execution : executions) {
|
||||
if(execution.getFlowId() != null) {
|
||||
AuthenticationFlowModel nonTopLevelFlow = realm.getAuthenticationFlowById(execution.getFlowId());
|
||||
realm.removeAuthenticationFlow(nonTopLevelFlow);
|
||||
}
|
||||
realm.removeAuthenticatorExecution(execution);
|
||||
}
|
||||
realm.removeAuthenticationFlow(flow);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue