fix(auth/ldap): allow to save internal authentication if custom ldap server is not set [EE-3155] (#7959)

pull/7967/head
Oscar Zhou 2022-11-03 10:06:56 +13:00 committed by GitHub
parent 37d4a80769
commit c8051b68d4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 13 additions and 1 deletions

View File

@ -34,7 +34,15 @@
</label>
<div class="col-sm-9 col-lg-10">
<div class="mb-3 flex" ng-repeat="url in $ctrl.settings.URLs track by $index">
<input type="text" class="form-control" id="ldap_url" ng-model="$ctrl.settings.URLs[$index]" placeholder="e.g. 10.0.0.10:389 or myldap.domain.tld:389" required />
<input
type="text"
class="form-control"
id="ldap_url"
ng-model="$ctrl.settings.URLs[$index]"
placeholder="e.g. 10.0.0.10:389 or myldap.domain.tld:389"
ng-model-options="{ allowInvalid: true }"
required
/>
<button ng-if="$index > 0" class="btn btn-sm btn-danger" type="button" ng-click="$ctrl.removeLDAPUrl($index)">
<pr-icon icon="'trash-2'" feather="true" size="'md'"></pr-icon>
</button>

View File

@ -166,6 +166,10 @@ function SettingsAuthenticationController($q, $scope, $state, Notifications, Set
}
settings.URLs = settings.URLs.map((url) => {
if (url === '') {
return;
}
if (url.includes(':')) {
return url;
}