Commit abb8bb50 authored by David Venhoek's avatar David Venhoek Committed by Sietse Ringers
Browse files

Moved keyshare server over to server.LogMiddleware

parent d484dc13
......@@ -24,7 +24,6 @@ import (
"github.com/privacybydesign/irmago/server/irmaserver"
"github.com/go-chi/chi"
"github.com/go-chi/chi/middleware"
)
type SessionData struct {
......@@ -107,7 +106,12 @@ func (s *Server) clearSessions() {
func (s *Server) Handler() http.Handler {
router := chi.NewRouter()
router.Use(middleware.Logger)
if s.conf.Verbose >= 2 {
opts := server.LogOptions{Response: true, Headers: true, From: false, EncodeBinary: true}
router.Use(server.LogMiddleware("keyshare-app", opts))
}
// Registration
router.Post("/client/register", s.handleRegister)
......
......@@ -59,6 +59,12 @@ func (s *Server) Stop() {
func (s *Server) Handler() http.Handler {
router := chi.NewRouter()
if s.conf.Verbose >= 2 {
opts := server.LogOptions{Response: true, Headers: true, From: false, EncodeBinary: true}
router.Use(server.LogMiddleware("keyshare-myirma", opts))
}
// Session management
router.Post("/checksession", s.handleCheckSession)
router.Post("/login/irma", s.handleIrmaLogin)
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment