* Revert "Auth: Revert "Auth: Cache Auth Info" (#81013)"
This reverts commit ce84f7c540.
* fix cache invalidation during user takeover
* fix incomplete test
This commit is contained in:
@@ -3,6 +3,7 @@ package remotecache
|
||||
import (
|
||||
"context"
|
||||
"crypto/tls"
|
||||
"errors"
|
||||
"fmt"
|
||||
"strconv"
|
||||
"strings"
|
||||
@@ -93,7 +94,15 @@ func (s *redisStorage) Set(ctx context.Context, key string, data []byte, expires
|
||||
|
||||
// GetByteArray returns the value as byte array
|
||||
func (s *redisStorage) Get(ctx context.Context, key string) ([]byte, error) {
|
||||
return s.c.Get(ctx, key).Bytes()
|
||||
item, err := s.c.Get(ctx, key).Bytes()
|
||||
if err != nil {
|
||||
if errors.Is(err, redis.Nil) {
|
||||
return nil, ErrCacheItemNotFound
|
||||
}
|
||||
return nil, err
|
||||
}
|
||||
|
||||
return item, nil
|
||||
}
|
||||
|
||||
// Delete delete a key from session.
|
||||
|
||||
Reference in New Issue
Block a user