Commit dd7084f2 authored by Sietse Ringers's avatar Sietse Ringers
Browse files

fix: prevent IRMA session log entries from appearing twice in keyshare and myirma sessions

parent 3408bfa7
......@@ -110,15 +110,15 @@ func (s *Server) clearSessions() {
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("keyshareserver", opts))
}
router.Group(func(router chi.Router) {
router.Use(server.SizeLimitMiddleware)
router.Use(server.TimeoutMiddleware(nil, server.WriteTimeout))
if s.conf.Verbose >= 2 {
opts := server.LogOptions{Response: true, Headers: true, From: false, EncodeBinary: true}
router.Use(server.LogMiddleware("keyshareserver", opts))
}
// Registration
router.Post("/client/register", s.handleRegister)
......
......@@ -80,17 +80,17 @@ 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))
}
router.Use(cors.New(corsOptions).Handler)
router.Group(func(router chi.Router) {
router.Use(server.SizeLimitMiddleware)
router.Use(server.TimeoutMiddleware(nil, server.WriteTimeout))
if s.conf.Verbose >= 2 {
opts := server.LogOptions{Response: true, Headers: true, From: false, EncodeBinary: true}
router.Use(server.LogMiddleware("keyshare-myirma", opts))
}
// Login/logout
router.Post("/login/irma", s.handleIrmaLogin)
router.Post("/login/email", s.handleEmailLogin)
......
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