mirror of
https://github.com/casdoor/casdoor.git
synced 2025-05-23 02:35:49 +08:00
feat: support MFA fields in syncer (#2966)
* feat:add fields of sync-database * feat:add fields of sync-database
This commit is contained in:
parent
e2cd0604c2
commit
40ad3c9234
@ -169,6 +169,12 @@ func (syncer *Syncer) setUserByKeyValue(user *User, key string, value string) {
|
||||
user.TotpSecret = value
|
||||
case "SignupApplication":
|
||||
user.SignupApplication = value
|
||||
case "MfaPhoneEnabled":
|
||||
user.MfaPhoneEnabled = util.ParseBool(value)
|
||||
case "MfaEmailEnabled":
|
||||
user.MfaEmailEnabled = util.ParseBool(value)
|
||||
case "RecoveryCodes":
|
||||
user.RecoveryCodes = strings.Split(value, ",")
|
||||
}
|
||||
}
|
||||
|
||||
@ -303,6 +309,9 @@ func (syncer *Syncer) getMapFromOriginalUser(user *OriginalUser) map[string]stri
|
||||
m["PreferredMfaType"] = user.PreferredMfaType
|
||||
m["TotpSecret"] = user.TotpSecret
|
||||
m["SignupApplication"] = user.SignupApplication
|
||||
m["MfaPhoneEnabled"] = util.BoolToString(user.MfaPhoneEnabled)
|
||||
m["MfaEmailEnabled"] = util.BoolToString(user.MfaEmailEnabled)
|
||||
m["RecoveryCodes"] = strings.Join(user.RecoveryCodes, ",")
|
||||
|
||||
m2 := map[string]string{}
|
||||
for _, tableColumn := range syncer.TableColumns {
|
||||
|
@ -1468,7 +1468,7 @@ export function getUserCommonFields() {
|
||||
return ["Owner", "Name", "CreatedTime", "UpdatedTime", "DeletedTime", "Id", "Type", "Password", "PasswordSalt", "DisplayName", "FirstName", "LastName", "Avatar", "PermanentAvatar",
|
||||
"Email", "EmailVerified", "Phone", "Location", "Address", "Affiliation", "Title", "IdCardType", "IdCard", "Homepage", "Bio", "Tag", "Region",
|
||||
"Language", "Gender", "Birthday", "Education", "Score", "Ranking", "IsDefaultAvatar", "IsOnline", "IsAdmin", "IsForbidden", "IsDeleted", "CreatedIp",
|
||||
"PreferredMfaType", "TotpSecret", "SignupApplication"];
|
||||
"PreferredMfaType", "TotpSecret", "SignupApplication", "RecoveryCodes", "MfaPhoneEnabled", "MfaEmailEnabled"];
|
||||
}
|
||||
|
||||
export function getDefaultFooterContent() {
|
||||
|
Loading…
x
Reference in New Issue
Block a user