diff --git a/csrf.go b/csrf.go index 03b9a50..14cb756 100644 --- a/csrf.go +++ b/csrf.go @@ -3,6 +3,7 @@ package middleware import ( "crypto/rand" "crypto/subtle" + "encoding/base64" "errors" "strings" "time" @@ -163,6 +164,8 @@ func CSRFWithConfig(config CSRFConfig) Interceptor { return } + + token = []byte(base64.RawURLEncoding.EncodeToString(token)) } switch {