Skip to content

Commit

Permalink
consent: Removes stray fmt.Print
Browse files Browse the repository at this point in the history
  • Loading branch information
arekkas committed May 19, 2018
1 parent 05722ca commit 515f816
Showing 1 changed file with 0 additions and 5 deletions.
5 changes: 0 additions & 5 deletions consent/helper.go
Expand Up @@ -23,8 +23,6 @@ package consent
import (
"net/http"

"fmt"

"github.com/gorilla/sessions"
"github.com/ory/fosite"
"github.com/ory/go-convenience/mapx"
Expand Down Expand Up @@ -65,8 +63,6 @@ func createCsrfSession(w http.ResponseWriter, r *http.Request, store sessions.St
session.Values["csrf"] = csrf
session.Options.HttpOnly = true
session.Options.Secure = secure
fmt.Printf("\n\n\n\nCREATE COOKIE %+v\n\n\n\n", session.Values)

if err := session.Save(r, w); err != nil {
return errors.WithStack(err)
}
Expand All @@ -78,7 +74,6 @@ func validateCsrfSession(r *http.Request, store sessions.Store, name, expectedCS
if cookie, err := store.Get(r, name); err != nil {
return errors.WithStack(fosite.ErrRequestForbidden.WithDebug("CSRF session cookie could not be decoded"))
} else if csrf, err := mapx.GetString(cookie.Values, "csrf"); err != nil {
fmt.Printf("\n\n\n\nGOT COOKIE %+v\n\n\n\nHEADER: %+v", cookie.Values, r.Header)
return errors.WithStack(fosite.ErrRequestForbidden.WithDebug("No CSRF value available in the session cookie"))
} else if csrf != expectedCSRF {
return errors.WithStack(fosite.ErrRequestForbidden.WithDebug("The CSRF value from the token does not match the CSRF value from the data store"))
Expand Down

0 comments on commit 515f816

Please sign in to comment.