Force confirm of user email does not work if the confirmation period has expired

Summary

In admin UI, we provide a method to force confirm the email of a user:

Screenshot_2020-10-12_at_6.30.45_PM

However, this does not work if the confirmation period has expired (as per Devise setting). Even if the action returns success, the user still remains unconfirmed.

Steps to reproduce

  • Register as new user.
  • From admin UI, try to confirm this user after n days has passed, where n is the confirm_within period set in Devise settings. (this is 1 day currently in GitLab)
  • Action returns success, but the user remains unverified.

Example Project

What is the current bug behavior?

What is the expected correct behavior?

Relevant logs and/or screenshots

Output of checks

Results of GitLab environment info

Expand for output related to GitLab environment info
(For installations with omnibus-gitlab package run and paste the output of:
`sudo gitlab-rake gitlab:env:info`)

(For installations from source run and paste the output of:
`sudo -u git -H bundle exec rake gitlab:env:info RAILS_ENV=production`)

Results of GitLab application Check

Expand for output related to the GitLab application check

(For installations with omnibus-gitlab package run and paste the output of: sudo gitlab-rake gitlab:check SANITIZE=true)

(For installations from source run and paste the output of: sudo -u git -H bundle exec rake gitlab:check RAILS_ENV=production SANITIZE=true)

(we will only investigate if the tests are passing)

Possible fixes

Edited by Manoj M J