fix: redis save error when KickTokens (#3002)

This commit is contained in:
icey-yu
2024-12-25 18:07:25 +08:00
committed by OpenIM-Robot
parent 3e872d6c5a
commit 52052a9165
3 changed files with 8 additions and 7 deletions
+2 -2
View File
@@ -56,7 +56,7 @@ func (a *authDatabase) SetTokenMapByUidPid(ctx context.Context, userID string, p
}
func (a *authDatabase) BatchSetTokenMapByUidPid(ctx context.Context, tokens []string) error {
setMap := make(map[string]map[string]int)
setMap := make(map[string]map[string]any)
for _, token := range tokens {
claims, err := tokenverify.GetClaimFromToken(token, authverify.Secret(a.accessSecret))
key := cachekey.GetTokenKey(claims.UserID, claims.PlatformID)
@@ -66,7 +66,7 @@ func (a *authDatabase) BatchSetTokenMapByUidPid(ctx context.Context, tokens []st
if v, ok := setMap[key]; ok {
v[token] = constant.KickedToken
} else {
setMap[key] = map[string]int{
setMap[key] = map[string]any{
token: constant.KickedToken,
}
}