updated jwt and added share token invalidation
This commit is contained in:
parent
095fb1573b
commit
c28249e1ce
11 changed files with 48 additions and 34 deletions
|
|
@ -22,11 +22,11 @@ func genKey(length int) (bytes []byte) {
|
|||
|
||||
func newXsrf(secret []byte) string {
|
||||
rnd := genKey(keySize)
|
||||
return base64.StdEncoding.EncodeToString(append(rnd, xor(rnd, secret)...))
|
||||
return base64.RawStdEncoding.EncodeToString(append(rnd, xor(rnd, secret)...))
|
||||
}
|
||||
|
||||
func checkXsrf(xsrf string, secret []byte) bool {
|
||||
t, err := base64.StdEncoding.DecodeString(xsrf)
|
||||
t, err := base64.RawStdEncoding.DecodeString(xsrf)
|
||||
if err != nil {
|
||||
return false
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue