Skip to content

Commit

Permalink
fix: do not send debug on session/whoami
Browse files Browse the repository at this point in the history
Closes #483
  • Loading branch information
aeneasr committed Jul 2, 2020
1 parent 2609002 commit 16d3670
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions session/handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ type (
handlerDependencies interface {
ManagementProvider
x.WriterProvider
x.LoggingProvider
}
HandlerProvider interface {
SessionHandler() *Handler
Expand Down Expand Up @@ -73,9 +74,9 @@ func (h *Handler) RegisterAdminRoutes(admin *x.RouterAdmin) {
func (h *Handler) whoami(w http.ResponseWriter, r *http.Request, ps httprouter.Params) {
s, err := h.r.SessionManager().FetchFromRequest(r.Context(), r)
if err != nil {
h.r.Audit().WithRequest(r).WithError(err).Info("No valid session cookie found.")
h.r.Writer().WriteError(w, r,
errors.WithStack(herodot.ErrUnauthorized.WithReasonf("No valid session cookie found.").WithDebugf("%+v", err)),
)
errors.WithStack(herodot.ErrUnauthorized.WithReasonf("No valid session cookie found.")))
return
}

Expand Down

0 comments on commit 16d3670

Please sign in to comment.