internal: add more tracing for states

Signed-off-by: Jens Langhammer <jens.langhammer@beryju.org>
This commit is contained in:
Jens Langhammer 2022-09-07 09:53:07 +02:00
parent 3e70b6443a
commit 220f123b29
1 changed files with 6 additions and 0 deletions

View File

@ -5,6 +5,7 @@ import (
"fmt"
"net/http"
log "github.com/sirupsen/logrus"
"golang.org/x/oauth2"
)
@ -19,6 +20,11 @@ func (a *Application) redeemCallback(r *http.Request, states []string) (*Claims,
found = true
}
}
a.log.WithFields(log.Fields{
"states": states,
"expected": state,
"found": found,
}).Trace("tracing states")
if !found {
return nil, fmt.Errorf("invalid state")
}