Log mismatched state

This commit is contained in:
Peter Stuifzand 2019-02-25 20:09:43 +01:00
parent 12f65072f2
commit e7de7703ab

View File

@ -115,10 +115,12 @@ func (*authHandler) ServeHTTP(w http.ResponseWriter, r *http.Request) {
return return
} }
} else if r.URL.Path == "/auth/callback" { } else if r.URL.Path == "/auth/callback" {
code := r.FormValue("code") log.Printf("%+v\n", sess)
state := r.FormValue("state") code := r.URL.Query().Get("code")
state := r.URL.Query().Get("state")
if state != sess.State { if state != sess.State {
log.Printf("mismatched state: %s != %s", state, sess.State)
http.Error(w, "mismatched state", 500) http.Error(w, "mismatched state", 500)
return return
} }