forgejo/models
forgejo-backport-action c0d11a365f [v11.0/forgejo] fix: user activation with uppercase email address (#8385)
**Backport:** https://codeberg.org/forgejo/forgejo/pulls/8367

- Right before the call to user email activation, the user is updated [^1]. This causes the email to be lowered, which in turn makes the call to activate the user activation fail (on database where collation is case sensitive, which is the recommend collation by Forgejo).
- The code in `BeforeUpdate` is quite confusing, the comment has become slightly out of date and was reworded to reflect reality and its purpose. The code is also slightly reworked to only lower the email for the `AvatarEmail` field to avoid causing side-effect.
- Added unit test.
- Resolves forgejo/forgejo#8354

[^1]: 4927d4ee3d/routers/web/auth/auth.go (L785)

Co-authored-by: Gusted <postmaster@gusted.xyz>
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/8385
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
Co-authored-by: forgejo-backport-action <forgejo-backport-action@noreply.codeberg.org>
Co-committed-by: forgejo-backport-action <forgejo-backport-action@noreply.codeberg.org>
2025-07-02 14:09:24 +02:00
..
actions [v11.0/forgejo] chore: branding import path (#7354) 2025-03-27 20:13:05 +00:00
activities [v11.0/forgejo] chore: branding import path (#7354) 2025-03-27 20:13:05 +00:00
admin [v11.0/forgejo] chore: branding import path (#7354) 2025-03-27 20:13:05 +00:00
asymkey [v11.0/forgejo] chore: branding import path (#7354) 2025-03-27 20:13:05 +00:00
auth fix(sec): consider webauthn for external login 2025-05-02 07:31:20 +02:00
avatars [v11.0/forgejo] chore: branding import path (#7354) 2025-03-27 20:13:05 +00:00
db [v11.0/forgejo] chore(cleanup): suppress non actionable XORM warnings (#8022) 2025-05-30 13:43:41 +02:00
dbfs [v11.0/forgejo] chore: branding import path (#7354) 2025-03-27 20:13:05 +00:00
fixtures [v11.0/forgejo] fix: user activation with uppercase email address (#8385) 2025-07-02 14:09:24 +02:00
forgefed [v11.0/forgejo] chore: branding import path (#7354) 2025-03-27 20:13:05 +00:00
forgejo/semver [v11.0/forgejo] chore: branding import path (#7354) 2025-03-27 20:13:05 +00:00
forgejo_migrations [v11.0/forgejo] fix: match PackageBlob.HashBlake2b definition and migration (#7544) 2025-04-15 07:40:53 +00:00
git [v11.0/forgejo] chore: merge tests.AddFixtures and unittest.OverrideFixtures (#7649) 2025-04-25 09:59:30 +00:00
issues [v11.0/forgejo] fix: aggregate deleted team as ghost team (#8000) 2025-05-29 18:31:26 +02:00
migrations [v11.0/forgejo] chore: branding import path (#7354) 2025-03-27 20:13:05 +00:00
organization [v11.0/forgejo] fix: show membership of limited orgs (#8095) 2025-06-07 01:59:55 +02:00
packages [v11.0/forgejo] chore: merge tests.AddFixtures and unittest.OverrideFixtures (#7649) 2025-04-25 09:59:30 +00:00
perm [v11.0/forgejo] chore: branding import path (#7354) 2025-03-27 20:13:05 +00:00
project [v11.0/forgejo] chore: branding import path (#7354) 2025-03-27 20:13:05 +00:00
pull [v11.0/forgejo] chore: branding import path (#7354) 2025-03-27 20:13:05 +00:00
quota [v11.0/forgejo] fix: ignore expired artifacts for quota calculation (#7985) 2025-05-28 19:00:00 +02:00
repo [v11.0/forgejo] chore: merge tests.AddFixtures and unittest.OverrideFixtures (#7649) 2025-04-25 09:59:30 +00:00
secret [v11.0/forgejo] chore: branding import path (#7354) 2025-03-27 20:13:05 +00:00
shared/types [v11.0/forgejo] chore: branding import path (#7354) 2025-03-27 20:13:05 +00:00
system [v11.0/forgejo] chore: branding import path (#7354) 2025-03-27 20:13:05 +00:00
unit [v11.0/forgejo] chore: branding import path (#7354) 2025-03-27 20:13:05 +00:00
unittest [v11.0/forgejo] chore: replace github.com/go-testfixtures/testfixtures (#7729) 2025-04-30 13:21:04 +00:00
user [v11.0/forgejo] fix: user activation with uppercase email address (#8385) 2025-07-02 14:09:24 +02:00
webhook [v11.0/forgejo] chore: branding import path (#7354) 2025-03-27 20:13:05 +00:00
error.go [v11.0/forgejo] chore: branding import path (#7354) 2025-03-27 20:13:05 +00:00
main_test.go [v11.0/forgejo] chore: branding import path (#7354) 2025-03-27 20:13:05 +00:00
org.go [v11.0/forgejo] chore: branding import path (#7354) 2025-03-27 20:13:05 +00:00
org_team.go [v11.0/forgejo] chore: branding import path (#7354) 2025-03-27 20:13:05 +00:00
org_team_test.go [v11.0/forgejo] chore: branding import path (#7354) 2025-03-27 20:13:05 +00:00
org_test.go [v11.0/forgejo] chore: branding import path (#7354) 2025-03-27 20:13:05 +00:00
repo.go [v11.0/forgejo] chore: branding import path (#7354) 2025-03-27 20:13:05 +00:00
repo_test.go [v11.0/forgejo] chore: branding import path (#7354) 2025-03-27 20:13:05 +00:00
repo_transfer.go [v11.0/forgejo] chore: branding import path (#7354) 2025-03-27 20:13:05 +00:00
repo_transfer_test.go [v11.0/forgejo] chore: branding import path (#7354) 2025-03-27 20:13:05 +00:00