fix: fix incorrect LDAP sync status (#1859)

This commit is contained in:
Yaodong Yu
2023-05-18 22:03:53 +08:00
committed by GitHub
parent 2eefeaffa7
commit 6455734807
5 changed files with 38 additions and 39 deletions

View File

@ -94,7 +94,7 @@ class LdapSyncPage extends React.Component {
if (res.status === "ok") {
this.setState((prevState) => {
prevState.users = res.data.users;
prevState.existUuids = res.data2?.length > 0 ? res.data2 : [];
prevState.existUuids = res.data2?.length > 0 ? res.data2.filter(uuid => uuid !== "") : [];
return prevState;
});
} else {
@ -210,7 +210,7 @@ class LdapSyncPage extends React.Component {
});
},
getCheckboxProps: record => ({
disabled: this.state.existUuids.indexOf(record.uuid) !== -1,
disabled: this.state.existUuids.indexOf(record.uuid) !== -1 || record.uidNumber === "",
}),
};

View File

@ -242,6 +242,7 @@ class LoginPage extends React.Component {
if (resp.msg === RequiredMfa) {
Setting.goToLink(`/prompt/${application.name}?redirectUri=${oAuthParams.redirectUri}&code=${code}&state=${oAuthParams.state}&promptType=mfa`);
return;
}
if (Setting.isPromptAnswered(account, application)) {