Skip to content

Display current user's username in email verification page

Related to https://gitlab.com/gitlab-org/modelops/anti-abuse/team-tasks/-/issues/710.

What does this MR do and why?

Similar to Display current user's username in Identity Ver... (!159509 - merged), this MR updates the email verification page to display the currently signed in user's username.

MR acceptance checklist

Please evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.

Screenshots or screen recordings

Screenshot_2024-08-21_at_2.56.04_PM

How to set up and validate locally

  1. Start GDK

  2. Enable require_email_verification feature flag

    $ rails c
    > Feature.enable(:require_email_verification)
  3. Apply the following code changes

    diff --git a/app/controllers/concerns/verifies_with_email.rb b/app/controllers/concerns/verifies_with_email.rb
    index cb8aef11e8d28..0bd6d90b143cc 100644
    --- a/app/controllers/concerns/verifies_with_email.rb
    +++ b/app/controllers/concerns/verifies_with_email.rb
    @@ -157,9 +157,10 @@ def handle_verification_success(user)
       end
    
       def trusted_ip_address?(user)
    -    return true if Feature.disabled?(:check_ip_address_for_email_verification)
    +    false
    +    # return true if Feature.disabled?(:check_ip_address_for_email_verification)
    
    -    AuthenticationEvent.initial_login_or_known_ip_address?(user, request.ip)
    +    # AuthenticationEvent.initial_login_or_known_ip_address?(user, request.ip)
       end
    
       def prompt_for_email_verification(user)
    
  4. Login with any user

  5. Verify that the username is displayed on the email verification page like the screenshot above

Edited by Eugie Limpin

Merge request reports