From cd2ad43328dca4402b80168854377c72b646165d Mon Sep 17 00:00:00 2001 From: Umputun Date: Wed, 14 Feb 2018 14:35:30 -0600 Subject: [PATCH] restore FB avatars --- app/rest/auth/providers.go | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/app/rest/auth/providers.go b/app/rest/auth/providers.go index b548c976..6dac954d 100644 --- a/app/rest/auth/providers.go +++ b/app/rest/auth/providers.go @@ -79,18 +79,18 @@ func NewFacebook(p Params) Provider { } userInfo.ID = "facebook_" + userInfo.ID - // picture under picture[data[url]] - // if p, ok := data["picture"]; ok { - // if picMap, ok := p.(map[string]interface{}); ok { - // if d, ok := picMap["data"]; ok { - // if dataMap, ok := d.(map[string]interface{}); ok { - // if picURL, ok := dataMap["url"]; ok { - // userInfo.Picture = picURL.(string) - // } - // } - // } - // } - // } + // picture under picture[data[url]] TODO: make this horror simpler + if p, ok := data["picture"]; ok { + if picMap, ok := p.(map[string]interface{}); ok { + if d, ok := picMap["data"]; ok { + if dataMap, ok := d.(map[string]interface{}); ok { + if picURL, ok := dataMap["url"]; ok { + userInfo.Picture = picURL.(string) + } + } + } + } + } return userInfo }, })