From 0f18c6ff16ffb73e70e495de3b6620ff40085e2c Mon Sep 17 00:00:00 2001 From: LittleSheep Date: Mon, 7 Oct 2024 00:53:23 +0800 Subject: [PATCH] :bug: Hotfix panic when getting auth context from cache --- .idea/dataSources.local.xml | 2 +- .idea/workspace.xml | 4 ++-- pkg/internal/services/auth.go | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.idea/dataSources.local.xml b/.idea/dataSources.local.xml index e62230f..4f33b4d 100644 --- a/.idea/dataSources.local.xml +++ b/.idea/dataSources.local.xml @@ -1,6 +1,6 @@ - + " diff --git a/.idea/workspace.xml b/.idea/workspace.xml index 5b58e3a..9d6dd92 100644 --- a/.idea/workspace.xml +++ b/.idea/workspace.xml @@ -109,8 +109,8 @@ - diff --git a/pkg/internal/services/auth.go b/pkg/internal/services/auth.go index 4bf74e4..bcbfa82 100644 --- a/pkg/internal/services/auth.go +++ b/pkg/internal/services/auth.go @@ -60,7 +60,7 @@ func GetAuthContext(jti string) (models.AuthContext, error) { contx := context.Background() if val, err := marshal.Get(contx, GetAuthContextCacheKey(jti), new(models.AuthContext)); err == nil { - ctx = val.(models.AuthContext) + ctx = *val.(*models.AuthContext) } else { ctx, err = CacheAuthContext(jti) log.Debug().Str("jti", jti).Msg("Created a new auth context cache")