diff --git a/services/auth/source/oauth2/flashii/flashii.go b/services/auth/source/oauth2/flashii/flashii.go index 03ed6bdf38..4a5c4d827a 100644 --- a/services/auth/source/oauth2/flashii/flashii.go +++ b/services/auth/source/oauth2/flashii/flashii.go @@ -125,17 +125,12 @@ func (p *Provider) FetchUser(session goth.Session) (goth.User, error) { } func userFromReader(reader io.Reader, user *goth.User) error { - type FlashiiUserAvatarRes struct { - Resolution int32 `json:"res"` - URL string `json:"url"` - } - u := struct { - Id string `json:"id"` - Name string `json:"name"` - Email string `json:"email"` - Title string `json:"title"` - AvatarURLs []FlashiiUserAvatarRes `json:"avatar_urls"` + Id string `json:"id"` + Name string `json:"name"` + Email string `json:"email"` + Title string `json:"title"` + AvatarURL string `json:"avatar_url"` }{} err := json.NewDecoder(reader).Decode(&u) @@ -147,7 +142,7 @@ func userFromReader(reader io.Reader, user *goth.User) error { user.NickName = u.Name user.Email = u.Email user.Description = u.Title - user.AvatarURL = u.AvatarURLs[0].URL + user.AvatarURL = u.AvatarURL return err }