Skip to content

Conversation

@lexiv0re
Copy link
Collaborator

  • Adds track of password changed events

Related to: https://front.hc.engineering/workbench/platform/tracker/EQMS-1401

Signed-off-by: Alexey Zinoviev <alexey.zinoviev@xored.com>
@huly-github-staging
Copy link

Connected to Huly®: UBERF-14084

Copilot finished reviewing on behalf of lexiv0re November 15, 2025 20:54
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR adds tracking for password change events by introducing a new PASSWORD_CHANGED event type and recording it whenever a password is set. The implementation includes utility functions to query password change history and a database migration to optimize event queries.

  • New PASSWORD_CHANGED event type added to AccountEventType enum
  • setPassword function updated to record password change events
  • Two new query functions: getLastPasswordChangeEvent and isPasswordChangedSince
  • Database index added for efficient password change event queries
  • Comprehensive test coverage for the new query functions

Reviewed Changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.

File Description
server/account/src/types.ts Added PASSWORD_CHANGED event type to the AccountEventType enum
server/account/src/utils.ts Updated setPassword to record events; added getLastPasswordChangeEvent and isPasswordChangedSince utility functions; renamed parameter from personUuid to accountUuid for consistency
server/account/src/collections/postgres/migrations.ts Added v22 migration to create a composite index on account_events table for optimized password change queries
server/account/src/tests/utils.test.ts Added comprehensive test suites for getLastPasswordChangeEvent and isPasswordChangedSince functions

@ArtyomSavchenko ArtyomSavchenko merged commit 02fa0f4 into develop Nov 17, 2025
18 of 21 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants