mirror of
https://github.com/pomerium/pomerium.git
synced 2025-05-09 23:27:43 +02:00
internal/logs: make non error conditions less scary in logs
internal/metrics: simplified struct definition with fmt -s. internal/metrics: added full path to package name.
This commit is contained in:
parent
2172d64205
commit
4d4293fc46
6 changed files with 18 additions and 23 deletions
|
@ -229,16 +229,13 @@ func isCORSPreflight(r *http.Request) bool {
|
|||
func (p *Proxy) Proxy(w http.ResponseWriter, r *http.Request) {
|
||||
if !p.shouldSkipAuthentication(r) {
|
||||
s, err := p.restStore.LoadSession(r)
|
||||
if err != nil {
|
||||
log.FromRequest(r).Debug().Err(err).Msg("proxy: no bearer auth token found")
|
||||
}
|
||||
|
||||
if s == nil {
|
||||
// if authorization bearer token does not exist or fails, use cookie store
|
||||
if err != nil || s == nil {
|
||||
s, err = p.sessionStore.LoadSession(r)
|
||||
if err != nil {
|
||||
switch err {
|
||||
case http.ErrNoCookie, sessions.ErrLifetimeExpired, sessions.ErrInvalidSession:
|
||||
log.FromRequest(r).Debug().Err(err).Msg("proxy: invalid session")
|
||||
log.FromRequest(r).Debug().Str("cause", err.Error()).Msg("proxy: invalid session, start auth process")
|
||||
p.sessionStore.ClearSession(w, r)
|
||||
p.OAuthStart(w, r)
|
||||
return
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue