mirror of
https://github.com/casdoor/casdoor.git
synced 2025-05-23 02:35:49 +08:00
Fix bug in getDefaultLoginMethod()
This commit is contained in:
parent
f5395f15f9
commit
8968396ae5
@ -201,7 +201,7 @@ class LoginPage extends React.Component {
|
|||||||
}
|
}
|
||||||
|
|
||||||
getDefaultLoginMethod(application) {
|
getDefaultLoginMethod(application) {
|
||||||
if (application?.signinMethods.length > 0) {
|
if (application?.signinMethods?.length > 0) {
|
||||||
switch (application?.signinMethods[0].name) {
|
switch (application?.signinMethods[0].name) {
|
||||||
case "Password": return "password";
|
case "Password": return "password";
|
||||||
case "Verification code": {
|
case "Verification code": {
|
||||||
@ -937,7 +937,7 @@ class LoginPage extends React.Component {
|
|||||||
[generateItemKey("LDAP", "None"), {label: i18next.t("login:LDAP"), key: "ldap"}],
|
[generateItemKey("LDAP", "None"), {label: i18next.t("login:LDAP"), key: "ldap"}],
|
||||||
]);
|
]);
|
||||||
|
|
||||||
application?.signinMethods.forEach((signinMethod) => {
|
application?.signinMethods?.forEach((signinMethod) => {
|
||||||
const item = itemsMap.get(generateItemKey(signinMethod.name, signinMethod.rule));
|
const item = itemsMap.get(generateItemKey(signinMethod.name, signinMethod.rule));
|
||||||
if (item) {
|
if (item) {
|
||||||
const label = signinMethod.name === signinMethod.displayName ? item.label : signinMethod.displayName;
|
const label = signinMethod.name === signinMethod.displayName ? item.label : signinMethod.displayName;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user