dbg for fb pic
This commit is contained in:
+1
-1
@@ -189,7 +189,7 @@ func makeAuthProviders(sessionStore sessions.Store) []auth.Provider {
|
||||
// post-flush callback invoked by cache after each flush in async way
|
||||
func postFlushFn() {
|
||||
for _, site := range opts.Sites {
|
||||
resp, err := http.Get("http://localhost:8080/api/v1/list?site=" + site)
|
||||
resp, err := http.Get(fmt.Sprintf("http://localhost:%d/api/v1/list?site=%s", opts.ServerCommand.Port, site))
|
||||
if err != nil {
|
||||
log.Printf("[WARN] failed to refresh cached list for %s, %s", site, err)
|
||||
return
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package auth
|
||||
|
||||
import (
|
||||
"log"
|
||||
"strings"
|
||||
|
||||
"golang.org/x/oauth2/facebook"
|
||||
@@ -71,19 +72,19 @@ func NewFacebook(p Params) Provider {
|
||||
Store: p.SessionStore,
|
||||
MapUser: func(data userData) store.User {
|
||||
userInfo := store.User{
|
||||
ID: data.value("id"),
|
||||
Name: data.value("name"),
|
||||
Profile: data.value("home"),
|
||||
ID: data.value("id"),
|
||||
Name: data.value("name"),
|
||||
}
|
||||
if userInfo.Name == "" {
|
||||
userInfo.Name = userInfo.ID
|
||||
}
|
||||
userInfo.ID = "facebook_" + userInfo.ID
|
||||
|
||||
log.Printf("%T", data["picture"])
|
||||
// picture under picture[data[url]]
|
||||
if p, ok := data["picture"]; ok {
|
||||
if data, ok := p.(map[string]interface{}); ok {
|
||||
if picURL, ok := data["url"]; ok {
|
||||
if d, ok := p.(map[string]interface{}); ok {
|
||||
if picURL, ok := d["url"]; ok {
|
||||
userInfo.Picture = picURL.(string)
|
||||
}
|
||||
}
|
||||
|
||||
+7
-2
@@ -22,9 +22,14 @@ services:
|
||||
- BOLTDB_PATH=/srv/var/db
|
||||
- BACKUP_PATH=/srv/var/backup
|
||||
- SESSION_STORE=/srv/var/session
|
||||
- DEV=true # development mode flag. It turns authentication off, be careful!
|
||||
# - DEV=true # development mode flag. It turns authentication off, be careful!
|
||||
- DEBUG=true
|
||||
|
||||
- REMARK_GOOGLE_CID
|
||||
- REMARK_GOOGLE_CSEC
|
||||
- REMARK_GITHUB_CID
|
||||
- REMARK_GITHUB_CSEC
|
||||
- REMARK_FACEBOOK_CID
|
||||
- REMARK_FACEBOOK_CSEC
|
||||
volumes:
|
||||
- ./var:/srv/var
|
||||
- ./web:/srv/web # maps web directory directly to propagate local changes to container without redeploy
|
||||
|
||||
Reference in New Issue
Block a user