mirror of
https://github.com/casdoor/casdoor.git
synced 2025-09-08 12:11:03 +08:00
feat: fix XML bug in GenerateCasToken()
This commit is contained in:
@@ -77,9 +77,9 @@ type CasUserAttributes struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
type CasNamedAttribute struct {
|
type CasNamedAttribute struct {
|
||||||
XMLName xml.Name `xml:"cas:attribute" json:"-"`
|
XMLName xml.Name `xml:"cas:attribute" json:"-"`
|
||||||
Name string `xml:"name,attr,omitempty"`
|
Name string `xml:"name,attr,omitempty"`
|
||||||
Value interface{} `xml:",innerxml"`
|
Value string `xml:",innerxml"`
|
||||||
}
|
}
|
||||||
|
|
||||||
type CasAnyAttribute struct {
|
type CasAnyAttribute struct {
|
||||||
@@ -219,7 +219,7 @@ func GenerateCasToken(userId string, service string) (string, error) {
|
|||||||
if v != "" {
|
if v != "" {
|
||||||
authenticationSuccess.Attributes.UserAttributes.Attributes = append(authenticationSuccess.Attributes.UserAttributes.Attributes, &CasNamedAttribute{
|
authenticationSuccess.Attributes.UserAttributes.Attributes = append(authenticationSuccess.Attributes.UserAttributes.Attributes, &CasNamedAttribute{
|
||||||
Name: k,
|
Name: k,
|
||||||
Value: v,
|
Value: fmt.Sprintf("%v", v),
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user