From e0423b8683d7d5a1f6817af22193fb3f9ba9348d Mon Sep 17 00:00:00 2001 From: Dmitry Verkhoturov Date: Fri, 22 Mar 2024 10:12:25 +0100 Subject: [PATCH] fix type for value for refresh token cache It was set to string by mistake, proper type is token.Claims. --- backend/app/cmd/server.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/backend/app/cmd/server.go b/backend/app/cmd/server.go index 5936dda2..d1667742 100644 --- a/backend/app/cmd/server.go +++ b/backend/app/cmd/server.go @@ -1327,11 +1327,11 @@ func splitAtCommas(s string) []string { // authRefreshCache used by authenticator to minimize repeatable token refreshes type authRefreshCache struct { - cache.LoadingCache[string] + cache.LoadingCache[token.Claims] } func newAuthRefreshCache() *authRefreshCache { - o := cache.NewOpts[string]() + o := cache.NewOpts[token.Claims]() expirableCache, _ := cache.NewExpirableCache(o.TTL(5 * time.Minute)) return &authRefreshCache{LoadingCache: expirableCache} } @@ -1343,5 +1343,5 @@ func (c *authRefreshCache) Get(key interface{}) (interface{}, bool) { // Set implements cache setter with key converted to string func (c *authRefreshCache) Set(key, value interface{}) { - _, _ = c.LoadingCache.Get(key.(string), func() (string, error) { return value.(string), nil }) + _, _ = c.LoadingCache.Get(key.(string), func() (token.Claims, error) { return value.(token.Claims), nil }) }