mirror of
https://github.com/casdoor/casdoor.git
synced 2025-07-03 04:10:20 +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:
@ -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 {
|
||||
|
Reference in New Issue
Block a user