From 9bf535d06f5b9bb455979b0bf3b6f0942daa1c9e Mon Sep 17 00:00:00 2001 From: kolaente Date: Mon, 10 Apr 2023 13:32:16 +0200 Subject: [PATCH] fix: remove old saved openid provider settings from cache when starting Vikunja Resolves https://kolaente.dev/vikunja/api/issues/1487 --- pkg/initialize/init.go | 2 ++ pkg/modules/auth/openid/providers.go | 4 ++++ 2 files changed, 6 insertions(+) diff --git a/pkg/initialize/init.go b/pkg/initialize/init.go index 6af4068d3bd..24906b9ccfe 100644 --- a/pkg/initialize/init.go +++ b/pkg/initialize/init.go @@ -27,6 +27,7 @@ import ( "code.vikunja.io/api/pkg/mail" "code.vikunja.io/api/pkg/migration" "code.vikunja.io/api/pkg/models" + "code.vikunja.io/api/pkg/modules/auth/openid" "code.vikunja.io/api/pkg/modules/keyvalue" migrator "code.vikunja.io/api/pkg/modules/migration" "code.vikunja.io/api/pkg/notifications" @@ -98,6 +99,7 @@ func FullInit() { user.RegisterDeletionNotificationCron() models.RegisterUserDeletionCron() models.RegisterOldExportCleanupCron() + openid.CleanupSavedOpenIDProviders() // Start processing events go func() { diff --git a/pkg/modules/auth/openid/providers.go b/pkg/modules/auth/openid/providers.go index e260e9b3ccc..c1c434d823b 100644 --- a/pkg/modules/auth/openid/providers.go +++ b/pkg/modules/auth/openid/providers.go @@ -161,3 +161,7 @@ func getProviderFromMap(pi map[string]interface{}) (provider *Provider, err erro return } + +func CleanupSavedOpenIDProviders() { + _ = keyvalue.Del("openid_providers") +}