mirror of
https://github.com/pomerium/pomerium.git
synced 2025-04-30 02:46:30 +02:00
Merge pull request #208 from desimone/feature/add-login-redirect-on-internal-urls
proxy: add auth redirect to internal urls
This commit is contained in:
commit
79f96eab52
2 changed files with 4 additions and 3 deletions
|
@ -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
|
||||
|
||||
|
|
|
@ -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
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue