diff --git a/app/views/admin/users/show.html.haml b/app/views/admin/users/show.html.haml
index bee7e10906bde3e37bcde53e9de9f4a9f821b137..46fe6bed05ed35bbb3c09c88cdbe4b3dc18150b3 100644
--- a/app/views/admin/users/show.html.haml
+++ b/app/views/admin/users/show.html.haml
@@ -128,6 +128,11 @@
%strong
= Gitlab::Access.human_access_with_none(@user.highest_role)
+ %li
+ %span.light= _("Email reset removed at:")
+ %strong
+ = @user.email_reset_offered_at || _('never')
+
= render_if_exists 'admin/users/using_license_seat', user: @user
- if @user.ldap_user?
diff --git a/doc/api/users.md b/doc/api/users.md
index 53f99bb59f4744aa36c266ca264c797c357d3b24..ad4e9c7f1b280e4241c22cc5f40c7dfe2375f4e3 100644
--- a/doc/api/users.md
+++ b/doc/api/users.md
@@ -136,6 +136,7 @@ GET /users?without_project_bots=true
> - The `created_by` field in the response was [introduced](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/93092) in GitLab 15.6.
> - The `scim_identities` field in the response [introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/324247) in GitLab 16.1.
> - The `auditors` field in the response [introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/418023) in GitLab 16.2.
+> - The `email_reset_offered_at` field in the response [introduced](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/137610) in GitLab 16.7.
```plaintext
GET /users
@@ -197,7 +198,8 @@ You can use all [parameters available for everyone](#for-non-administrator-users
"current_sign_in_ip": "196.165.1.102",
"last_sign_in_ip": "172.127.2.22",
"namespace_id": 1,
- "created_by": null
+ "created_by": null,
+ "email_reset_offered_at": null
},
{
"id": 2,
@@ -235,7 +237,8 @@ You can use all [parameters available for everyone](#for-non-administrator-users
"current_sign_in_ip": "10.165.1.102",
"last_sign_in_ip": "172.127.2.22",
"namespace_id": 2,
- "created_by": null
+ "created_by": null,
+ "email_reset_offered_at": null
}
]
```
@@ -380,6 +383,7 @@ Parameters:
> - The `namespace_id` field in the response was [introduced](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/82045) in GitLab 14.10.
> - The `created_by` field in the response was [introduced](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/93092) in GitLab 15.6.
+> - The `email_reset_offered_at` field in the response [introduced](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/137610) in GitLab 16.7.
```plaintext
GET /users/:id
@@ -445,7 +449,8 @@ Example Responses:
"trial": true,
"sign_in_count": 1337,
"namespace_id": 1,
- "created_by": null
+ "created_by": null,
+ "email_reset_offered_at": null
}
```
@@ -728,6 +733,7 @@ Users on [GitLab Premium or Ultimate](https://about.gitlab.com/pricing/) also se
> - The `namespace_id` field in the response was [introduced](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/82045) in GitLab 14.10.
> - The `created_by` field in the response was [introduced](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/93092) in GitLab 15.6.
+> - The `email_reset_offered_at` field in the response [introduced](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/137610) in GitLab 16.7.
```plaintext
GET /user
@@ -783,6 +789,7 @@ Parameters:
"last_sign_in_ip": "172.127.2.22",
"namespace_id": 1,
"created_by": null,
+ "email_reset_offered_at": null,
"note": null
}
```
diff --git a/lib/api/entities/user_with_admin.rb b/lib/api/entities/user_with_admin.rb
index 53fef7a46e2f3fb1a0fa659d9ea01d38a507438e..25c1edb4526eb3e7b9b099fe1955d2cebc1aff10 100644
--- a/lib/api/entities/user_with_admin.rb
+++ b/lib/api/entities/user_with_admin.rb
@@ -7,6 +7,7 @@ class UserWithAdmin < UserPublic
expose :note
expose :namespace_id
expose :created_by, with: UserBasic
+ expose :email_reset_offered_at
end
end
end
diff --git a/locale/gitlab.pot b/locale/gitlab.pot
index 67b5d53a254b8c37ed090ee8c02adc8d8cbd4d6b..87f71854629dad8a131a71ce1d89df16d0ead00e 100644
--- a/locale/gitlab.pot
+++ b/locale/gitlab.pot
@@ -18214,6 +18214,9 @@ msgstr ""
msgid "Email patch"
msgstr ""
+msgid "Email reset removed at:"
+msgstr ""
+
msgid "Email sent"
msgstr ""
diff --git a/spec/requests/api/users_spec.rb b/spec/requests/api/users_spec.rb
index b63ea71efe6430ee7fce09c2730fe3acd3104309..86c4e04ef71a4b4daffbb6aca9671e5f399ee4bf 100644
--- a/spec/requests/api/users_spec.rb
+++ b/spec/requests/api/users_spec.rb
@@ -182,6 +182,7 @@
expect(json_response.first).not_to have_key('note')
expect(json_response.first).not_to have_key('namespace_id')
expect(json_response.first).not_to have_key('created_by')
+ expect(json_response.first).not_to have_key('email_reset_offered_at')
end
end
@@ -194,6 +195,7 @@
expect(json_response.first).not_to have_key('note')
expect(json_response.first).not_to have_key('namespace_id')
expect(json_response.first).not_to have_key('created_by')
+ expect(json_response.first).not_to have_key('email_reset_offered_at')
end
end
@@ -203,6 +205,7 @@
expect(response).to have_gitlab_http_status(:success)
expect(json_response.first).to have_key('note')
+ expect(json_response.first).to have_key('email_reset_offered_at')
expect(json_response.first['note']).to eq '2018-11-05 | 2FA removed | user requested | www.gitlab.com'
end