mirror of
https://github.com/casdoor/casdoor.git
synced 2025-05-23 10:45:47 +08:00
feat: fix isSigninMethodEnabled() bug in frontend
This commit is contained in:
parent
73e44df867
commit
f5395f15f9
@ -1131,36 +1131,28 @@ export function renderLogo(application) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
export function isPasswordEnabled(application) {
|
function isSigninMethodEnabled(application, signinMethod) {
|
||||||
if (application) {
|
if (application && application.signinMethods) {
|
||||||
return application.signinMethods.filter(item => item.name === "Password").length > 0;
|
return application.signinMethods.filter(item => item.name === signinMethod).length > 0;
|
||||||
} else {
|
} else {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export function isPasswordEnabled(application) {
|
||||||
|
return isSigninMethodEnabled(application, "Password");
|
||||||
|
}
|
||||||
|
|
||||||
export function isCodeSigninEnabled(application) {
|
export function isCodeSigninEnabled(application) {
|
||||||
if (application) {
|
return isSigninMethodEnabled(application, "Verification code");
|
||||||
return application.signinMethods.filter(item => item.name === "Verification code").length > 0;
|
|
||||||
} else {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
export function isWebAuthnEnabled(application) {
|
export function isWebAuthnEnabled(application) {
|
||||||
if (application) {
|
return isSigninMethodEnabled(application, "WebAuthn");
|
||||||
return application.signinMethods.filter(item => item.name === "WebAuthn").length > 0;
|
|
||||||
} else {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
export function isLdapEnabled(application) {
|
export function isLdapEnabled(application) {
|
||||||
if (application) {
|
return isSigninMethodEnabled(application, "LDAP");
|
||||||
return application.signinMethods.filter(item => item.name === "LDAP").length > 0;
|
|
||||||
} else {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
export function getLoginLink(application) {
|
export function getLoginLink(application) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user