halkyon/apps/learn/halkyon_learn_client/lib/migrations
Repository files (latest commit first)
Filename Latest commit message Latest commit date
Tizian 「ティツィアーン」 e8c4a3d472
fix(auth): a session's wrong codes end the session, not the account's codes
Wrong codes for removing an authenticator, new recovery codes or confirming
one counted toward the account's waits (the re-review's third finding): a
stolen session alone, without the password, could keep the owner's codes
waiting for up to a day at a time, renewed without end, holding them out
of signing in and of changing the password, the way to end that session,
and nobody was mailed. Those codes now count per session, where the session
is (the register's own, or a member's, which forwards the code): each try
counted before its code is checked (one statement, so tries sent at once
count each), a code accepted clearing the count, and the tenth wrong in a
row ending the session (sessionEnded; the device says it was signed out).
A try that checked no code (a refusal of something else) is taken back.
The account's waits now count only codes after a right password, and the
per-account ten tries an hour, which a session could fill as well, go.

Migration (module, Learn's and Todo's servers, Learn's device schema):
CREATE TABLE "session_code_failures" ("id" bigserial PRIMARY KEY,
"sessionId" uuid NOT NULL, "authUserId" uuid NOT NULL, "failures"
bigint NOT NULL, "updatedAt" timestamp NOT NULL) with a unique index on
"sessionId": a new table, nothing touched. Its rows go with a code
accepted, with the person, and hourly once their session is gone.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Tizian 「ティツィアーン」 <raisondetredev@pm.me>
2026-10-23 14:12:47 +02:00
..
20260930094729362-studysets chore: Halkyon Learn moves into apps/learn 2026-10-22 18:11:02 +02:00
20260930122235111-cards chore: Halkyon Learn moves into apps/learn 2026-10-22 18:11:02 +02:00
20260930145136285-reviews chore: Halkyon Learn moves into apps/learn 2026-10-22 18:11:02 +02:00
20261001064926911-tree-tags-assets chore: Halkyon Learn moves into apps/learn 2026-10-22 18:11:02 +02:00
20261002191122122-notes chore: Halkyon Learn moves into apps/learn 2026-10-22 18:11:02 +02:00
20261002211346701-learning-paths chore: Halkyon Learn moves into apps/learn 2026-10-22 18:11:02 +02:00
20261003110855698-pdf-sources chore: Halkyon Learn moves into apps/learn 2026-10-22 18:11:02 +02:00
20261007205440868-card-buried-at chore: Halkyon Learn moves into apps/learn 2026-10-22 18:11:02 +02:00
20261008165051407-pdf-position chore: Halkyon Learn moves into apps/learn 2026-10-22 18:11:02 +02:00
20261009224606274-feedback chore: Halkyon Learn moves into apps/learn 2026-10-22 18:11:02 +02:00
20261012162411835-studyset-deleted-at chore: Halkyon Learn moves into apps/learn 2026-10-22 18:11:02 +02:00
20261019121406578-halkyon-base chore: Halkyon Learn moves into apps/learn 2026-10-22 18:11:02 +02:00
20261019201023295-profiles-in-halkyon-base refactor(profile): handles and profiles move into halkyon_base 2026-10-22 18:11:07 +02:00
20261019204112282-deletion-notices feat(accounts): one account across an instance's services (ADR 0016) 2026-10-22 18:11:07 +02:00
20261020111943300-passwords feat(auth): Learn's and Todo's servers take password sign-in 2026-10-22 18:11:11 +02:00
20261020125117584-sessions-ended feat(auth): change the password and the recovery phrase while signed in 2026-10-23 14:12:40 +02:00
20261020185750538-recovery-proof-key fix(auth)!: the recovery phrase is proved by a key of its own 2026-10-23 14:12:43 +02:00
20261020194228286-second-factor-waits fix(auth): codes wait after ten wrong in a row, and the owner is told 2026-10-23 14:12:44 +02:00
20261020204619104-session-code-tries fix(auth): a session's wrong codes end the session, not the account's codes 2026-10-23 14:12:47 +02:00
migration_registry.dart fix(auth): a session's wrong codes end the session, not the account's codes 2026-10-23 14:12:47 +02:00