🐛 Fix wrong condition on check auth context is cached

This commit is contained in:
LittleSheep 2024-09-22 14:32:55 +08:00
parent 27b625e0c8
commit cec234bc53

View File

@ -59,7 +59,7 @@ func GetAuthContext(jti string) (models.AuthContext, error) {
marshal := marshaler.New(cacheManager)
contx := context.Background()
if val, err := marshal.Get(contx, GetAuthContextCacheKey(jti), new(models.AuthContext)); err != nil {
if val, err := marshal.Get(contx, GetAuthContextCacheKey(jti), new(models.AuthContext)); err == nil {
ctx = val.(models.AuthContext)
} else {
ctx, err = CacheAuthContext(jti)