🐛 Transform CSRF token into base64URL string
This commit is contained in:
parent
869deb6305
commit
9b3bdd440f
3
csrf.go
3
csrf.go
|
@ -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 {
|
||||||
|
|
Loading…
Reference in New Issue