Skip to content

locked account fixes - #657

Open
varmar05 wants to merge 1 commit into
developfrom
locked_account_fixes
Open

locked account fixes#657
varmar05 wants to merge 1 commit into
developfrom
locked_account_fixes

Conversation

@varmar05

@varmar05 varmar05 commented Aug 4, 2026

Copy link
Copy Markdown
Collaborator

Use LoginHistory for account lockout. Enable all attempts to be stored in the table (needs periodic pruning to avoid storing archive data). Also DB-sync agent is now fully tracked in login_history table.

Display custom message in FE when account is locked.

- failed_login_attempts counter replaced by LoginHistory.count_recent_failures()
  over a configurable LOCKOUT_WINDOW, so old failures age out instead of
  persisting indefinitely until a successful login
- LoginHistory now records every login attempt, successful and failed
  (including from the DB-sync client), instead of only successes
- index migration split out and built CONCURRENTLY so it doesn't hold a
  write-blocking lock on login_history for the duration of the build
- login form shows a dedicated message on AccountLocked instead of the
  raw backend error text

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@varmar05
varmar05 requested a review from MarcelGeo August 4, 2026 11:51
@coveralls

Copy link
Copy Markdown

Coverage Report for CI Build 30906549419

Coverage increased (+0.03%) to 92.24%

Details

  • Coverage increased (+0.03%) from the base build.
  • Patch coverage: 73 of 73 lines across 3 files are fully covered (100%).
  • No coverage regressions found.

Uncovered Changes

No uncovered changes found.

Coverage Regressions

No coverage regressions found.


Coverage Stats

Coverage Status
Relevant Lines: 10309
Covered Lines: 9509
Line Coverage: 92.24%
Coverage Strength: 0.92 hits per line

💛 - Coveralls

await instanceStore.initApp()
} catch (error) {
} catch (err) {
const error = err as AxiosError

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

U can use axios.isAxiosError() method to check if it's error from request and not from code above. Better than forcing as AxiosError

def upgrade():
with op.get_context().autocommit_block():
op.execute(
"DROP INDEX CONCURRENTLY IF EXISTS ix_login_history_user_id_successful_timestamp"

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Is it possible in alembic?

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.

3 participants