mirror of
https://github.com/casdoor/casdoor.git
synced 2025-07-15 23:23:50 +08:00
Improve Face ID signin method UI
This commit is contained in:
@ -110,6 +110,11 @@
|
|||||||
"name": "WebAuthn",
|
"name": "WebAuthn",
|
||||||
"displayName": "WebAuthn",
|
"displayName": "WebAuthn",
|
||||||
"rule": "None"
|
"rule": "None"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "Face ID",
|
||||||
|
"displayName": "Face ID",
|
||||||
|
"rule": "None"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"signupItems": [
|
"signupItems": [
|
||||||
|
@ -311,6 +311,9 @@ func extendApplicationWithSigninMethods(application *Application) (err error) {
|
|||||||
signinMethod := &SigninMethod{Name: "WebAuthn", DisplayName: "WebAuthn", Rule: "None"}
|
signinMethod := &SigninMethod{Name: "WebAuthn", DisplayName: "WebAuthn", Rule: "None"}
|
||||||
application.SigninMethods = append(application.SigninMethods, signinMethod)
|
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 {
|
if len(application.SigninMethods) == 0 {
|
||||||
|
@ -184,6 +184,7 @@ func initBuiltInApplication() {
|
|||||||
{Name: "Password", DisplayName: "Password", Rule: "All"},
|
{Name: "Password", DisplayName: "Password", Rule: "All"},
|
||||||
{Name: "Verification code", DisplayName: "Verification code", Rule: "All"},
|
{Name: "Verification code", DisplayName: "Verification code", Rule: "All"},
|
||||||
{Name: "WebAuthn", DisplayName: "WebAuthn", Rule: "None"},
|
{Name: "WebAuthn", DisplayName: "WebAuthn", Rule: "None"},
|
||||||
|
{Name: "Face ID", DisplayName: "Face ID", Rule: "None"},
|
||||||
},
|
},
|
||||||
SignupItems: []*SignupItem{
|
SignupItems: []*SignupItem{
|
||||||
{Name: "ID", Visible: false, Required: true, Prompted: false, Rule: "Random"},
|
{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: "Password", displayName: "Password", rule: "All"},
|
||||||
{name: "Verification code", displayName: "Verification code", rule: "All"},
|
{name: "Verification code", displayName: "Verification code", rule: "All"},
|
||||||
{name: "WebAuthn", displayName: "WebAuthn", rule: "None"},
|
{name: "WebAuthn", displayName: "WebAuthn", rule: "None"},
|
||||||
|
{name: "Face ID", displayName: "Face ID", rule: "None"},
|
||||||
],
|
],
|
||||||
signupItems: [
|
signupItems: [
|
||||||
{name: "ID", visible: false, required: true, rule: "Random"},
|
{name: "ID", visible: false, required: true, rule: "Random"},
|
||||||
|
@ -1066,7 +1066,12 @@ class LoginPage extends React.Component {
|
|||||||
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;
|
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});
|
items.push({label: label, key: item.key});
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
Reference in New Issue
Block a user