mirror of
https://github.com/casdoor/casdoor.git
synced 2025-05-23 02:35:49 +08:00
Improve Face ID signin method UI
This commit is contained in:
parent
a19060c7cb
commit
e81ba62234
@ -110,6 +110,11 @@
|
||||
"name": "WebAuthn",
|
||||
"displayName": "WebAuthn",
|
||||
"rule": "None"
|
||||
},
|
||||
{
|
||||
"name": "Face ID",
|
||||
"displayName": "Face ID",
|
||||
"rule": "None"
|
||||
}
|
||||
],
|
||||
"signupItems": [
|
||||
|
@ -311,6 +311,9 @@ func extendApplicationWithSigninMethods(application *Application) (err error) {
|
||||
signinMethod := &SigninMethod{Name: "WebAuthn", DisplayName: "WebAuthn", Rule: "None"}
|
||||
application.SigninMethods = append(application.SigninMethods, signinMethod)
|
||||
}
|
||||
|
||||
signinMethod := &SigninMethod{Name: "Face ID", DisplayName: "Face ID", Rule: "None"}
|
||||
application.SigninMethods = append(application.SigninMethods, signinMethod)
|
||||
}
|
||||
|
||||
if len(application.SigninMethods) == 0 {
|
||||
|
@ -184,6 +184,7 @@ func initBuiltInApplication() {
|
||||
{Name: "Password", DisplayName: "Password", Rule: "All"},
|
||||
{Name: "Verification code", DisplayName: "Verification code", Rule: "All"},
|
||||
{Name: "WebAuthn", DisplayName: "WebAuthn", Rule: "None"},
|
||||
{Name: "Face ID", DisplayName: "Face ID", Rule: "None"},
|
||||
},
|
||||
SignupItems: []*SignupItem{
|
||||
{Name: "ID", Visible: false, Required: true, Prompted: false, Rule: "Random"},
|
||||
|
@ -50,6 +50,7 @@ class ApplicationListPage extends BaseListPage {
|
||||
{name: "Password", displayName: "Password", rule: "All"},
|
||||
{name: "Verification code", displayName: "Verification code", rule: "All"},
|
||||
{name: "WebAuthn", displayName: "WebAuthn", rule: "None"},
|
||||
{name: "Face ID", displayName: "Face ID", rule: "None"},
|
||||
],
|
||||
signupItems: [
|
||||
{name: "ID", visible: false, required: true, rule: "Random"},
|
||||
|
@ -1066,7 +1066,12 @@ class LoginPage extends React.Component {
|
||||
application?.signinMethods?.forEach((signinMethod) => {
|
||||
const item = itemsMap.get(generateItemKey(signinMethod.name, signinMethod.rule));
|
||||
if (item) {
|
||||
const label = signinMethod.name === signinMethod.displayName ? item.label : signinMethod.displayName;
|
||||
let label = signinMethod.name === signinMethod.displayName ? item.label : signinMethod.displayName;
|
||||
|
||||
if (application?.signinMethods?.length >= 4 && label === "Verification code") {
|
||||
label = "Code";
|
||||
}
|
||||
|
||||
items.push({label: label, key: item.key});
|
||||
}
|
||||
});
|
||||
|
Loading…
x
Reference in New Issue
Block a user