mirror of
https://github.com/casdoor/casdoor.git
synced 2025-05-23 02:35:49 +08:00
Add groups to UserInfo
This commit is contained in:
parent
c858d0e0b0
commit
0c118477e8
@ -173,16 +173,16 @@ type User struct {
|
||||
}
|
||||
|
||||
type Userinfo struct {
|
||||
Sub string `json:"sub"`
|
||||
Iss string `json:"iss"`
|
||||
Aud string `json:"aud"`
|
||||
Organization string `json:"organization,omitempty"`
|
||||
Name string `json:"preferred_username,omitempty"`
|
||||
DisplayName string `json:"name,omitempty"`
|
||||
Email string `json:"email,omitempty"`
|
||||
Avatar string `json:"picture,omitempty"`
|
||||
Address string `json:"address,omitempty"`
|
||||
Phone string `json:"phone,omitempty"`
|
||||
Sub string `json:"sub"`
|
||||
Iss string `json:"iss"`
|
||||
Aud string `json:"aud"`
|
||||
Name string `json:"preferred_username,omitempty"`
|
||||
DisplayName string `json:"name,omitempty"`
|
||||
Email string `json:"email,omitempty"`
|
||||
Avatar string `json:"picture,omitempty"`
|
||||
Address string `json:"address,omitempty"`
|
||||
Phone string `json:"phone,omitempty"`
|
||||
Groups []string `json:"groups,omitempty"`
|
||||
}
|
||||
|
||||
type ManagedAccount struct {
|
||||
@ -680,10 +680,10 @@ func GetUserInfo(user *User, scope string, aud string, host string) *Userinfo {
|
||||
Aud: aud,
|
||||
}
|
||||
if strings.Contains(scope, "profile") {
|
||||
resp.Organization = user.Owner
|
||||
resp.Name = user.Name
|
||||
resp.DisplayName = user.DisplayName
|
||||
resp.Avatar = user.Avatar
|
||||
resp.Groups = []string{user.Owner}
|
||||
}
|
||||
if strings.Contains(scope, "email") {
|
||||
resp.Email = user.Email
|
||||
|
Loading…
x
Reference in New Issue
Block a user