Fix nameFormat in SamlItem

This commit is contained in:
Yang Luo
2024-01-13 15:19:15 +08:00
parent 8968396ae5
commit 37748850c8
27 changed files with 44 additions and 86 deletions

View File

@ -42,7 +42,7 @@ type SignupItem struct {
type SamlItem struct {
Name string `json:"name"`
NameFormat string `json:"nameformat"`
NameFormat string `json:"nameFormat"`
Value string `json:"value"`
}
@ -347,6 +347,17 @@ func GetMaskedApplication(application *Application, userId string) *Application
return nil
}
if application.TokenFields == nil {
application.TokenFields = []string{}
}
if application.FailedSigninLimit == 0 {
application.FailedSigninLimit = DefaultFailedSigninLimit
}
if application.FailedSigninFrozenTime == 0 {
application.FailedSigninFrozenTime = DefaultFailedSigninFrozenTime
}
if userId != "" {
if isUserIdGlobalAdmin(userId) {
return application
@ -384,13 +395,6 @@ func GetMaskedApplication(application *Application, userId string) *Application
application.InvitationCodes = []string{"***"}
}
if application.FailedSigninLimit == 0 {
application.FailedSigninLimit = DefaultFailedSigninLimit
}
if application.FailedSigninFrozenTime == 0 {
application.FailedSigninFrozenTime = DefaultFailedSigninFrozenTime
}
return application
}