ability to use session cookie in login #47

This commit is contained in:
Umputun
2018-06-02 13:39:14 -05:00
parent c77a98542a
commit 7ae4a09f6b
7 changed files with 94 additions and 26 deletions
+1 -1
View File
@@ -46,7 +46,7 @@ func TestMiddleware_GetBodyAndUser(t *testing.T) {
assert.Equal(t, "", user, "no user")
req = rest.SetUserInfo(req, store.User{ID: "id1", Name: "user1"})
body, user = getBodyAndUser(req, []LoggerFlag{LogAll})
_, user = getBodyAndUser(req, []LoggerFlag{LogAll})
assert.Equal(t, ` - id1 "user1"`, user, "no user")
body, user = getBodyAndUser(req, nil)
+1 -1
View File
@@ -105,7 +105,7 @@ func (s *Rest) routes() chi.Router {
cache: s.Cache,
}
ipFn := func(ip string) string { return store.HashValue(ip, s.DataService.Secret)[:12] }
ipFn := func(ip string) string { return store.HashValue(ip, s.DataService.Secret)[:12] } // logger uses it for anonymization
// auth routes for all providers
router.Route("/auth", func(r chi.Router) {