fix(setting/auth): allow to save all auth method if custom ldap server is empty string (#7990)

pull/8023/head
Oscar Zhou 2022-11-10 08:28:09 +13:00 committed by GitHub
parent 16377221f9
commit e1e81731b9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 10 deletions

View File

@ -34,15 +34,7 @@
</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"
ng-model-options="{ allowInvalid: true }"
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" 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,7 +166,7 @@ function SettingsAuthenticationController($q, $scope, $state, Notifications, Set
}
settings.URLs = settings.URLs.map((url) => {
if (url === '') {
if (url === undefined || url === '') {
return;
}