Merge pull request #1706 from girirajsharma/Patch-Keycloak-1931

[KEYCLOAK-1931] UI doesn't reflect when flow is deleted.
This commit is contained in:
Stian Thorgersen 2015-10-12 13:48:45 +02:00
commit 10b4bd24a4
2 changed files with 9 additions and 0 deletions

View file

@ -1745,6 +1745,7 @@ module.controller('AuthenticationFlowsCtrl', function($scope, $route, realm, flo
execution.postLevels.push(j);
}
}
$location.url("/realms/" + realm.realm + "/authentication/flows/" + $scope.flow.alias);
})
};

View file

@ -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);
}