feat: add Hide-Password option for signin method rule field (#3258)

This commit is contained in:
DacongDA 2024-09-30 23:31:41 +08:00 committed by GitHub
parent bf730050d5
commit 3bd52172ea
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 5 additions and 1 deletions

View File

@ -1168,7 +1168,7 @@ export function renderLogo(application) {
function isSigninMethodEnabled(application, signinMethod) { function isSigninMethodEnabled(application, signinMethod) {
if (application && application.signinMethods) { if (application && application.signinMethods) {
return application.signinMethods.filter(item => item.name === signinMethod).length > 0; return application.signinMethods.filter(item => item.name === signinMethod && item.rule !== "Hide-Password").length > 0;
} else { } else {
return false; return false;
} }

View File

@ -1125,6 +1125,9 @@ class LoginPage extends React.Component {
]); ]);
application?.signinMethods?.forEach((signinMethod) => { application?.signinMethods?.forEach((signinMethod) => {
if (signinMethod.rule === "Hide-Password") {
return;
}
const item = itemsMap.get(generateItemKey(signinMethod.name, signinMethod.rule)); const item = itemsMap.get(generateItemKey(signinMethod.name, signinMethod.rule));
if (item) { if (item) {
let label = signinMethod.name === signinMethod.displayName ? item.label : signinMethod.displayName; let label = signinMethod.name === signinMethod.displayName ? item.label : signinMethod.displayName;

View File

@ -136,6 +136,7 @@ class SigninMethodTable extends React.Component {
options = [ options = [
{id: "All", name: i18next.t("general:All")}, {id: "All", name: i18next.t("general:All")},
{id: "Non-LDAP", name: i18next.t("general:Non-LDAP")}, {id: "Non-LDAP", name: i18next.t("general:Non-LDAP")},
{id: "Hide-Password", name: i18next.t("general:Hide-Password")},
]; ];
} }