From ef40ef35f920e1605cc91a0c2ebec180c3cddd36 Mon Sep 17 00:00:00 2001 From: wxiaoguang Date: Sat, 17 Feb 2024 13:07:52 +0800 Subject: [PATCH] optmize --- modules/setting/oauth2.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/modules/setting/oauth2.go b/modules/setting/oauth2.go index af74766362719..40f75dc23843b 100644 --- a/modules/setting/oauth2.go +++ b/modules/setting/oauth2.go @@ -167,7 +167,9 @@ func GetGeneralTokenSigningSecret() []byte { } if generalSigningSecret.CompareAndSwap(old, &jwtSecret) { log.Warn("OAuth2 is not enabled, unable to use a persistent signing secret, a new one is generated, which is not persistent between restarts and cluster nodes") + return jwtSecret } + return *generalSigningSecret.Load() } - return *generalSigningSecret.Load() + return *old }