Add EmailVerified to UserInfo

This commit is contained in:
Yang Luo 2023-09-08 18:27:14 +08:00
parent 16cd09d175
commit c62588f9bc

View File

@ -200,6 +200,7 @@ type Userinfo struct {
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"`
EmailVerified bool `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"`
@ -757,6 +758,7 @@ func GetUserInfo(user *User, scope string, aud string, host string) *Userinfo {
} }
if strings.Contains(scope, "email") { if strings.Contains(scope, "email") {
resp.Email = user.Email resp.Email = user.Email
resp.EmailVerified = user.EmailVerified
} }
if strings.Contains(scope, "address") { if strings.Contains(scope, "address") {
resp.Address = user.Location resp.Address = user.Location