Skip to content

Commit 1f79b5a

Browse files
authored
core: show last password change date (#12958)
Signed-off-by: Jens Langhammer <[email protected]>
1 parent 6185e7c commit 1f79b5a

File tree

3 files changed

+11
-0
lines changed

3 files changed

+11
-0
lines changed

authentik/core/api/users.py

+2
Original file line numberDiff line numberDiff line change
@@ -236,9 +236,11 @@ class Meta:
236236
"path",
237237
"type",
238238
"uuid",
239+
"password_change_date",
239240
]
240241
extra_kwargs = {
241242
"name": {"allow_blank": True},
243+
"password_change_date": {"read_only": True},
242244
}
243245

244246

schema.yml

+5
Original file line numberDiff line numberDiff line change
@@ -56494,11 +56494,16 @@ components:
5649456494
type: string
5649556495
format: uuid
5649656496
readOnly: true
56497+
password_change_date:
56498+
type: string
56499+
format: date-time
56500+
readOnly: true
5649756501
required:
5649856502
- avatar
5649956503
- groups_obj
5650056504
- is_superuser
5650156505
- name
56506+
- password_change_date
5650256507
- pk
5650356508
- uid
5650456509
- username

web/src/admin/users/UserViewPage.ts

+4
Original file line numberDiff line numberDiff line change
@@ -158,6 +158,10 @@ export class UserViewPage extends WithCapabilitiesConfig(AKElement) {
158158
? html`<div>${getRelativeTime(user.lastLogin)}</div>
159159
<small>${user.lastLogin.toLocaleString()}</small>`
160160
: html`${msg("-")}`],
161+
[msg("Last password change"), user.passwordChangeDate
162+
? html`<div>${getRelativeTime(user.passwordChangeDate)}</div>
163+
<small>${user.passwordChangeDate.toLocaleString()}</small>`
164+
: html`${msg("-")}`],
161165
[msg("Active"), html`<ak-status-label type="warning" ?good=${user.isActive}></ak-status-label>`],
162166
[msg("Type"), userTypeToLabel(user.type)],
163167
[msg("Superuser"), html`<ak-status-label type="warning" ?good=${user.isSuperuser}></ak-status-label>`],

0 commit comments

Comments
 (0)