diff --git a/CHANGELOG.md b/CHANGELOG.md index 06f0be549..22978c19d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -17,6 +17,7 @@ - Fixed HEADERS environment variable parsing [GH-188] - Fixed Azure group lookups [GH-190] - If a session is too large (over 4096 bytes) Pomerium will no longer fail silently. [GH-211] +- Internal URLs like dashboard now start auth process to login a user if no session is found [GH-205]. ## v0.0.5 diff --git a/proxy/handlers.go b/proxy/handlers.go index b80559804..95793136f 100644 --- a/proxy/handlers.go +++ b/proxy/handlers.go @@ -289,9 +289,9 @@ func (p *Proxy) Proxy(w http.ResponseWriter, r *http.Request) { func (p *Proxy) UserDashboard(w http.ResponseWriter, r *http.Request) { session, err := p.sessionStore.LoadSession(r) if err != nil { - log.FromRequest(r).Error().Err(err).Msg("proxy: load session failed") - httpErr := &httputil.Error{Message: err.Error(), Code: http.StatusBadRequest} - httputil.ErrorResponse(w, r, httpErr) + log.FromRequest(r).Debug().Str("cause", err.Error()).Msg("proxy: no session, redirecting to auth") + p.sessionStore.ClearSession(w, r) + p.OAuthStart(w, r) return }