fix(login): correctly reload policies on auth request (#7839)

This commit is contained in:
Livio Spring
2024-04-24 10:44:55 +02:00
committed by GitHub
parent 25030c69b9
commit ac985e2dfb
3 changed files with 26 additions and 11 deletions

View File

@@ -24,16 +24,20 @@ type AuthRequestCache struct {
}
func Start(dbClient *database.DB, amountOfCachedAuthRequests uint16) *AuthRequestCache {
cache := &AuthRequestCache{
client: dbClient,
}
idCache, err := lru.New[string, *domain.AuthRequest](int(amountOfCachedAuthRequests))
logging.OnError(err).Info("auth request cache disabled")
if err == nil {
cache.idCache = idCache
}
codeCache, err := lru.New[string, *domain.AuthRequest](int(amountOfCachedAuthRequests))
logging.OnError(err).Info("auth request cache disabled")
return &AuthRequestCache{
client: dbClient,
idCache: idCache,
codeCache: codeCache,
if err == nil {
cache.codeCache = codeCache
}
return cache
}
func (c *AuthRequestCache) Health(ctx context.Context) error {