1
0
mirror of https://github.com/kataras/iris.git synced 2026-01-07 12:07:28 +00:00

Upgrade Redis client to v9 (#2102)

Signed-off-by: Gerasimos (Makis) Maropoulos <kataras2006@hotmail.com>
Co-authored-by: Gerasimos (Makis) Maropoulos <kataras2006@hotmail.com>
This commit is contained in:
Phước Trung
2023-03-17 16:03:18 +07:00
committed by GitHub
parent bbe3da7733
commit 65bb98f055
4 changed files with 16 additions and 10 deletions

View File

@@ -8,7 +8,7 @@ import (
"github.com/kataras/iris/v12/core/host"
"github.com/kataras/iris/v12/middleware/jwt"
"github.com/go-redis/redis/v8"
"github.com/redis/go-redis/v9"
)
var defaultContext = context.Background()
@@ -138,7 +138,7 @@ func (b *Blocklist) ValidateToken(token []byte, c jwt.Claims, err error) error {
// InvalidateToken invalidates a verified JWT token.
func (b *Blocklist) InvalidateToken(token []byte, c jwt.Claims) error {
key := b.GetKey(token, c)
return b.client.SetEX(defaultContext, key, token, c.Timeleft()).Err()
return b.client.SetEx(defaultContext, key, token, c.Timeleft()).Err()
}
// Del removes a token from the storage.