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
|
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
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user