Skip to content

Commit

Permalink
Modify usage of LDAP ping API on UI
Browse files Browse the repository at this point in the history
Signed-off-by: AllForNothing <sshijun@vmware.com>
  • Loading branch information
AllForNothing committed Mar 15, 2021
1 parent 68d7c91 commit adf9e16
Showing 1 changed file with 8 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ import { clone, isEmpty, getChanges as getChangesFunc } from "../../../../shared
import { CONFIG_AUTH_MODE } from "../../../../shared/entities/shared.const";
import { errorHandler } from "../../../../shared/units/shared.utils";
import { Configuration } from "../config";
import { finalize } from "rxjs/operators";
const fakePass = 'aWpLOSYkIzJTTU4wMDkx';

@Component({
Expand Down Expand Up @@ -138,11 +139,14 @@ export class ConfigurationAuthComponent implements OnChanges, OnInit {
settings['ldap_scope'] = +settings['ldap_scope'];

this.configService.testLDAPServer(settings)
.subscribe(respone => {
this.testingOnGoing = false;
this.msgHandler.showSuccess('CONFIG.TEST_LDAP_SUCCESS');
.pipe(finalize(() => this.testingOnGoing = false))
.subscribe(res => {
if (res && res.success) {
this.msgHandler.showSuccess('CONFIG.TEST_LDAP_SUCCESS');
} else if (res && res.message) {
this.msgHandler.showError('CONFIG.TEST_LDAP_FAILED', { 'param': res.message });
}
}, error => {
this.testingOnGoing = false;
let err = errorHandler(error);
if (!err || !err.trim()) {
err = 'UNKNOWN';
Expand Down

0 comments on commit adf9e16

Please sign in to comment.