mirror of
https://github.com/casdoor/casdoor.git
synced 2025-05-24 08:20:31 +08:00
feat: add Hide-Password option for signin method rule field (#3258)
This commit is contained in:
parent
bf730050d5
commit
3bd52172ea
@ -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;
|
||||||
}
|
}
|
||||||
|
@ -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;
|
||||||
|
@ -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")},
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user