Skip to content

Database governance built for humans and agents — controlling changes and access across every major database.

fix: password rotation checks (#17194)

boojack9d9ae4f2489e
diff --git a/backend/api/v1/auth_service.go b/backend/api/v1/auth_service.go
index 1a8b12f8a4..76184ecaa3 100644
--- a/backend/api/v1/auth_service.go
+++ b/backend/api/v1/auth_service.go
@@ -235,12 +235,12 @@ func (s *AuthService) needResetPassword(ctx context.Context, user *store.UserMes
return count > 1
}
- if passwordRestriction.PasswordRotation != nil && passwordRestriction.PasswordRotation.GetNanos() > 0 {
+ if passwordRestriction.PasswordRotation != nil {
lastChangePasswordTime := user.CreatedAt
if user.Profile.LastChangePasswordTime != nil {
lastChangePasswordTime = user.Profile.LastChangePasswordTime.AsTime()
}
- if lastChangePasswordTime.Add(time.Duration(passwordRestriction.PasswordRotation.GetNanos())).Before(time.Now()) {
+ if lastChangePasswordTime.Add(passwordRestriction.PasswordRotation.AsDuration()).Before(time.Now()) {
return true
}
}