🐛 Transform CSRF token into base64URL string

This commit is contained in:
Maxim Lebedev 2022-01-05 22:30:13 +05:00
parent 869deb6305
commit 9b3bdd440f
Signed by: toby3d
GPG Key ID: 1F14E25B7C119FC5
1 changed files with 3 additions and 0 deletions

View File

@ -3,6 +3,7 @@ package middleware
import ( import (
"crypto/rand" "crypto/rand"
"crypto/subtle" "crypto/subtle"
"encoding/base64"
"errors" "errors"
"strings" "strings"
"time" "time"
@ -163,6 +164,8 @@ func CSRFWithConfig(config CSRFConfig) Interceptor {
return return
} }
token = []byte(base64.RawURLEncoding.EncodeToString(token))
} }
switch { switch {