mirror of
https://github.com/casdoor/casdoor.git
synced 2025-05-23 10:45:47 +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 {
|
type Userinfo struct {
|
||||||
Sub string `json:"sub"`
|
Sub string `json:"sub"`
|
||||||
Iss string `json:"iss"`
|
Iss string `json:"iss"`
|
||||||
Aud string `json:"aud"`
|
Aud string `json:"aud"`
|
||||||
Organization string `json:"organization,omitempty"`
|
Name string `json:"preferred_username,omitempty"`
|
||||||
Name string `json:"preferred_username,omitempty"`
|
DisplayName string `json:"name,omitempty"`
|
||||||
DisplayName string `json:"name,omitempty"`
|
Email string `json:"email,omitempty"`
|
||||||
Email string `json:"email,omitempty"`
|
Avatar string `json:"picture,omitempty"`
|
||||||
Avatar string `json:"picture,omitempty"`
|
Address string `json:"address,omitempty"`
|
||||||
Address string `json:"address,omitempty"`
|
Phone string `json:"phone,omitempty"`
|
||||||
Phone string `json:"phone,omitempty"`
|
Groups []string `json:"groups,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
type ManagedAccount struct {
|
type ManagedAccount struct {
|
||||||
@ -680,10 +680,10 @@ func GetUserInfo(user *User, scope string, aud string, host string) *Userinfo {
|
|||||||
Aud: aud,
|
Aud: aud,
|
||||||
}
|
}
|
||||||
if strings.Contains(scope, "profile") {
|
if strings.Contains(scope, "profile") {
|
||||||
resp.Organization = user.Owner
|
|
||||||
resp.Name = user.Name
|
resp.Name = user.Name
|
||||||
resp.DisplayName = user.DisplayName
|
resp.DisplayName = user.DisplayName
|
||||||
resp.Avatar = user.Avatar
|
resp.Avatar = user.Avatar
|
||||||
|
resp.Groups = []string{user.Owner}
|
||||||
}
|
}
|
||||||
if strings.Contains(scope, "email") {
|
if strings.Contains(scope, "email") {
|
||||||
resp.Email = user.Email
|
resp.Email = user.Email
|
||||||
|
Loading…
x
Reference in New Issue
Block a user