Merge pull request #1777 from girirajsharma/keycloak-1993
[KEYCLOAK-1993] It's possible to create new authentication flow with empty name within another flow
This commit is contained in:
commit
cd01ea49b4
2 changed files with 5 additions and 1 deletions
|
@ -7,7 +7,7 @@
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label class="col-md-2 control-label" for="alias">Alias </label>
|
<label class="col-md-2 control-label" for="alias">Alias </label>
|
||||||
<div class="col-sm-6">
|
<div class="col-sm-6">
|
||||||
<input class="form-control" type="text" id="alias" name="alias" data-ng-model="flow.alias" autofocus>
|
<input class="form-control" type="text" id="alias" name="alias" data-ng-model="flow.alias" autofocus required>
|
||||||
</div>
|
</div>
|
||||||
<kc-tooltip>Specifies display name for the flow.</kc-tooltip>
|
<kc-tooltip>Specifies display name for the flow.</kc-tooltip>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -277,6 +277,10 @@ public class AuthenticationManagementResource {
|
||||||
public Response createFlow(AuthenticationFlowModel model) {
|
public Response createFlow(AuthenticationFlowModel model) {
|
||||||
this.auth.requireManage();
|
this.auth.requireManage();
|
||||||
|
|
||||||
|
if (model.getAlias() == null || model.getAlias().isEmpty()) {
|
||||||
|
return ErrorResponse.exists("Failed to create flow with empty alias name");
|
||||||
|
}
|
||||||
|
|
||||||
if (realm.getFlowByAlias(model.getAlias()) != null) {
|
if (realm.getFlowByAlias(model.getAlias()) != null) {
|
||||||
return ErrorResponse.exists("Flow " + model.getAlias() + " already exists");
|
return ErrorResponse.exists("Flow " + model.getAlias() + " already exists");
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue