core: show last password change date (#12958)

Signed-off-by: Jens Langhammer <jens@goauthentik.io>
This commit is contained in:
Jens L.
2025-02-10 16:13:04 +01:00
committed by GitHub
parent 6185e7cdc7
commit 1f79b5acb7
3 changed files with 11 additions and 0 deletions

View File

@ -236,9 +236,11 @@ class UserSerializer(ModelSerializer):
"path", "path",
"type", "type",
"uuid", "uuid",
"password_change_date",
] ]
extra_kwargs = { extra_kwargs = {
"name": {"allow_blank": True}, "name": {"allow_blank": True},
"password_change_date": {"read_only": True},
} }

View File

@ -56494,11 +56494,16 @@ components:
type: string type: string
format: uuid format: uuid
readOnly: true readOnly: true
password_change_date:
type: string
format: date-time
readOnly: true
required: required:
- avatar - avatar
- groups_obj - groups_obj
- is_superuser - is_superuser
- name - name
- password_change_date
- pk - pk
- uid - uid
- username - username

View File

@ -158,6 +158,10 @@ export class UserViewPage extends WithCapabilitiesConfig(AKElement) {
? html`<div>${getRelativeTime(user.lastLogin)}</div> ? html`<div>${getRelativeTime(user.lastLogin)}</div>
<small>${user.lastLogin.toLocaleString()}</small>` <small>${user.lastLogin.toLocaleString()}</small>`
: html`${msg("-")}`], : html`${msg("-")}`],
[msg("Last password change"), user.passwordChangeDate
? html`<div>${getRelativeTime(user.passwordChangeDate)}</div>
<small>${user.passwordChangeDate.toLocaleString()}</small>`
: html`${msg("-")}`],
[msg("Active"), html`<ak-status-label type="warning" ?good=${user.isActive}></ak-status-label>`], [msg("Active"), html`<ak-status-label type="warning" ?good=${user.isActive}></ak-status-label>`],
[msg("Type"), userTypeToLabel(user.type)], [msg("Type"), userTypeToLabel(user.type)],
[msg("Superuser"), html`<ak-status-label type="warning" ?good=${user.isSuperuser}></ak-status-label>`], [msg("Superuser"), html`<ak-status-label type="warning" ?good=${user.isSuperuser}></ak-status-label>`],