From 8556cc003a6ec7894353b6a8a614b8fa93f8924b Mon Sep 17 00:00:00 2001 From: Steven Martin Date: Fri, 21 Apr 2023 22:29:19 -0400 Subject: [PATCH 1/3] Populate the time locked and user set locked --- api/types/user.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/api/types/user.go b/api/types/user.go index 48ec73908a1ce..79dfaaf00328c 100644 --- a/api/types/user.go +++ b/api/types/user.go @@ -434,6 +434,8 @@ func (u *UserV2) SetLocked(until time.Time, reason string) { u.Spec.Status.IsLocked = true u.Spec.Status.LockExpires = until u.Spec.Status.LockedMessage = reason + u.Spec.Status.LockedTime = time.Now() + } // SetRecoveryAttemptLockExpires sets the lock expiry time for both recovery and login attempt. From c21c0320167436bdfe1c66761edff2d53ccb40c9 Mon Sep 17 00:00:00 2001 From: Steven Martin Date: Mon, 24 Apr 2023 10:13:35 -0400 Subject: [PATCH 2/3] remove extra line Co-authored-by: Zac Bergquist --- api/types/user.go | 1 - 1 file changed, 1 deletion(-) diff --git a/api/types/user.go b/api/types/user.go index 79dfaaf00328c..32b56638a23d9 100644 --- a/api/types/user.go +++ b/api/types/user.go @@ -435,7 +435,6 @@ func (u *UserV2) SetLocked(until time.Time, reason string) { u.Spec.Status.LockExpires = until u.Spec.Status.LockedMessage = reason u.Spec.Status.LockedTime = time.Now() - } // SetRecoveryAttemptLockExpires sets the lock expiry time for both recovery and login attempt. From 30d5674e0b6ba892b2e034f10d782b59548e2380 Mon Sep 17 00:00:00 2001 From: Steven Martin Date: Tue, 25 Apr 2023 06:41:52 -0700 Subject: [PATCH 3/3] use UTC Co-authored-by: rosstimothy <39066650+rosstimothy@users.noreply.github.com> --- api/types/user.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/api/types/user.go b/api/types/user.go index 32b56638a23d9..3fa330fba7f47 100644 --- a/api/types/user.go +++ b/api/types/user.go @@ -434,7 +434,7 @@ func (u *UserV2) SetLocked(until time.Time, reason string) { u.Spec.Status.IsLocked = true u.Spec.Status.LockExpires = until u.Spec.Status.LockedMessage = reason - u.Spec.Status.LockedTime = time.Now() + u.Spec.Status.LockedTime = time.Now().UTC() } // SetRecoveryAttemptLockExpires sets the lock expiry time for both recovery and login attempt.