From 99367076f453f256572373fd8bff6e93ba4e9279 Mon Sep 17 00:00:00 2001 From: Umputun Date: Wed, 14 Feb 2018 02:40:31 -0600 Subject: [PATCH] add missing step to get fb url under data --- app/rest/auth/providers.go | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/app/rest/auth/providers.go b/app/rest/auth/providers.go index 4970b989..7a05dc68 100644 --- a/app/rest/auth/providers.go +++ b/app/rest/auth/providers.go @@ -1,7 +1,6 @@ package auth import ( - "log" "strings" "golang.org/x/oauth2/facebook" @@ -82,10 +81,13 @@ func NewFacebook(p Params) Provider { // picture under picture[data[url]] if p, ok := data["picture"]; ok { - if d, ok := p.(map[string]interface{}); ok { - log.Printf("%+v", d) - if picURL, ok := d["url"]; ok { - userInfo.Picture = picURL.(string) + 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) + } + } } } }