diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2023-01-06 22:28:28 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2023-01-06 22:28:28 +0000 |
commit | e4a92d342784ccbb929e7d2b1faa42d6c2f591a3 (patch) | |
tree | 0e850cae1809a9224f5dcd773933777dbd4c17de /app/services | |
parent | 89e372068b3909b0e8cfb03af4da176357a1abbc (diff) | |
download | gitlab-ce-e4a92d342784ccbb929e7d2b1faa42d6c2f591a3.tar.gz |
Add latest changes from gitlab-org/security/gitlab@15-7-stable-ee
Diffstat (limited to 'app/services')
-rw-r--r-- | app/services/users/update_service.rb | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/app/services/users/update_service.rb b/app/services/users/update_service.rb index cb2711b6fee..96018db5974 100644 --- a/app/services/users/update_service.rb +++ b/app/services/users/update_service.rb @@ -31,6 +31,7 @@ module Users assign_identity build_canonical_email + reset_unconfirmed_email if @user.save(validate: validate) && update_status notify_success(user_exists) @@ -64,6 +65,13 @@ module Users Users::UpdateCanonicalEmailService.new(user: @user).execute end + def reset_unconfirmed_email + return unless @user.persisted? + return unless @user.email_changed? + + @user.update_column(:unconfirmed_email, nil) + end + def update_status return true unless @status_params |