adjust fb fileds

This commit is contained in:
Umputun
2018-02-14 01:39:40 -06:00
parent 8c23833b2c
commit dbe443c482
2 changed files with 6 additions and 4 deletions
+3 -3
View File
@@ -67,14 +67,14 @@ func NewFacebook(p Params) Provider {
Endpoint: facebook.Endpoint,
RedirectURL: p.RemarkURL + "/auth/facebook/callback",
Scopes: []string{"public_profile"},
InfoURL: "https://graph.facebook.com/me?fields=id,name,cover,website",
InfoURL: "https://graph.facebook.com/me?fields=id,name,picture,home",
Store: p.SessionStore,
MapUser: func(data userData) store.User {
userInfo := store.User{
ID: data.value("id"),
Name: data.value("name"),
Picture: data.value("cover"),
Profile: data.value("website"),
Picture: data.value("picture"),
Profile: data.value("home"),
}
if userInfo.Name == "" {
userInfo.Name = userInfo.ID
+3 -1
View File
@@ -64,9 +64,11 @@ func (s *Server) Run(port int) {
router.Use(middleware.RealIP, Recoverer)
router.Use(middleware.Throttle(1000), middleware.Timeout(60*time.Second))
router.Use(tollbooth_chi.LimitHandler(tollbooth.NewLimiter(10, nil)))
router.Use(AppInfo("remark42", s.Version), Ping, Logger(LogAll))
// all request by default allow anonymous access
router.Use(auth.Auth(s.SessionStore, s.Admins, maybeWithDevMode(auth.Anonymous)))
router.Use(AppInfo("remark42", s.Version), Ping, Logger(LogAll))
router.Use(context.ClearHandler) // if you aren't using gorilla/mux, you need to wrap your handlers with context.ClearHandler
// auth routes for all providers