From 43ded8ee30ab5c7a40a456600cdaa8a0fbdccec2 Mon Sep 17 00:00:00 2001 From: Earl Warren Date: Mon, 25 Dec 2023 14:06:57 +0100 Subject: [PATCH] [GITEA] Allow changing the email address before activation (squash) cache is always active This needs to be revisited because the MailResendLimit is not enforced and turns out to not be tested. See e7cb8da2a8 * Always enable caches (#28527) --- routers/web/auth/auth.go | 2 +- tests/integration/signup_test.go | 2 -- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/routers/web/auth/auth.go b/routers/web/auth/auth.go index 72a9e1d70a..d28dc62ffb 100644 --- a/routers/web/auth/auth.go +++ b/routers/web/auth/auth.go @@ -696,7 +696,7 @@ func ActivatePost(ctx *context.Context) { } // Change the primary email if setting.Service.RegisterEmailConfirm { - if setting.CacheService.Enabled && ctx.Cache.IsExist("MailResendLimit_"+ctx.Doer.LowerName) { + if false && ctx.Cache.IsExist("MailResendLimit_"+ctx.Doer.LowerName) { ctx.Data["ResendLimited"] = true } else { ctx.Data["ActiveCodeLives"] = timeutil.MinutesToFriendly(setting.Service.ActiveCodeLives, ctx.Locale) diff --git a/tests/integration/signup_test.go b/tests/integration/signup_test.go index eea4772b21..9cee944edc 100644 --- a/tests/integration/signup_test.go +++ b/tests/integration/signup_test.go @@ -99,7 +99,6 @@ func TestSignupEmailChangeForInactiveUser(t *testing.T) { // Disable the captcha & enable email confirmation for registrations defer test.MockVariableValue(&setting.Service.EnableCaptcha, false)() defer test.MockVariableValue(&setting.Service.RegisterEmailConfirm, true)() - defer test.MockVariableValue(&setting.CacheService.Enabled, false)() // Create user req := NewRequestWithValues(t, "POST", "/user/sign_up", map[string]string{ @@ -133,7 +132,6 @@ func TestSignupEmailChangeForActiveUser(t *testing.T) { // Disable the captcha & enable email confirmation for registrations defer test.MockVariableValue(&setting.Service.EnableCaptcha, false)() defer test.MockVariableValue(&setting.Service.RegisterEmailConfirm, false)() - defer test.MockVariableValue(&setting.CacheService.Enabled, false)() // Create user req := NewRequestWithValues(t, "POST", "/user/sign_up", map[string]string{