Log mismatched state
This commit is contained in:
parent
12f65072f2
commit
e7de7703ab
6
main.go
6
main.go
|
@ -115,10 +115,12 @@ func (*authHandler) ServeHTTP(w http.ResponseWriter, r *http.Request) {
|
|||
return
|
||||
}
|
||||
} else if r.URL.Path == "/auth/callback" {
|
||||
code := r.FormValue("code")
|
||||
state := r.FormValue("state")
|
||||
log.Printf("%+v\n", sess)
|
||||
code := r.URL.Query().Get("code")
|
||||
state := r.URL.Query().Get("state")
|
||||
|
||||
if state != sess.State {
|
||||
log.Printf("mismatched state: %s != %s", state, sess.State)
|
||||
http.Error(w, "mismatched state", 500)
|
||||
return
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user