feat: fix XML format issue in GenerateCasToken()

This commit is contained in:
Yang Luo 2023-09-15 22:38:04 +08:00
parent ece060d03d
commit ce7a2e924b

View File

@ -216,10 +216,15 @@ func GenerateCasToken(userId string, service string) (string, error) {
}
for k, v := range tmp {
value := fmt.Sprintf("%v", v)
if value == "<nil>" || value == "[]" || value == "map[]" {
value = ""
}
if v != "" {
authenticationSuccess.Attributes.UserAttributes.Attributes = append(authenticationSuccess.Attributes.UserAttributes.Attributes, &CasNamedAttribute{
Name: k,
Value: fmt.Sprintf("%v", v),
Value: value,
})
}
}