Skip to content

Commit

Permalink
[GITEA] Allow changing the email address before activation (squash) c…
Browse files Browse the repository at this point in the history
…ache is always active

This needs to be revisited because the MailResendLimit is not enforced
and turns out to not be tested.

See e7cb8da * Always enable caches (go-gitea#28527)
  • Loading branch information
earl-warren committed Dec 25, 2023
1 parent e21252f commit 43ded8e
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 3 deletions.
2 changes: 1 addition & 1 deletion routers/web/auth/auth.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 0 additions & 2 deletions tests/integration/signup_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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{
Expand Down Expand Up @@ -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{
Expand Down

0 comments on commit 43ded8e

Please sign in to comment.