Skip to content

A password lock emails the holder - #1419

Merged
dschmura merged 2 commits into
mainfrom
password-lock-emails-holder
Oct 16, 2026
Merged

dschmura merged 2 commits into
mainfrom
password-lock-emails-holder

Conversation

@dschmura

Copy link
Copy Markdown
Owner

The security guide says a locked holder "gets PasswordLockedNotifier by
email when the lock starts", and the sign-in page deliberately says nothing
about the lock (#1369). But the notifier declared no email delivery,
ApplicationNotifier supplies none, and DigestMailerJob leaves security
notifications out of the digest. A lock produced only an in-app notice,
which a signed-out holder never sees.

The notifier now delivers through NotificationMailer#password_locked,
with the same deliver_email_now? gate, before_enqueue abort and
per-recipient throttle as the new-device alert. HTML and text templates say
how long password sign-in is paused, that an emailed link or a passkey
still works, and link to sign-in. A suspended holder gets none, through the
mailer's existing gate.

  • spec/notifiers/password_locked_notifier_spec.rb (new) drains Noticed's
    jobs and asserts the mail reaches the holder, and that it still does
    under quiet hours.
  • notification_mailer_spec: heading, duration, sign-in link, throttle.
  • mailers_axe_spec: the new mail passes the AAA audit.
  • The notifications guide listed PasswordLockedNotifier twice; once now.

Not in this PR: PasswordChangedNotifier has the same gap. The
notifications guide's example shows it with deliver_by :email, but the
class has none, and there is no NotificationMailer#password_changed.

Found by Copilot's review of the MClassrooms sync
(lsa-mis#119).

Verify

  • Mailer, notifier, gate and i18n specs: 672 examples, 0 failures; mail
    specs with the AAA audit: 36 examples, 0 failures.
  • Pre-push bin/parallel-rspec: 6054 examples, 0 failures.

PasswordLockedNotifier declared no email delivery, and DigestMailerJob
leaves security notifications out of the digest, so a lock produced only an
in-app notice that the signed-out holder never sees, while the security
guide said the holder is told by email. The notifier now delivers through
NotificationMailer#password_locked, gated and throttled like the new-device
alert, with HTML and text templates. A notifier spec drains Noticed's jobs
and asserts the mail reaches the holder, under quiet hours too; the mailer
spec and the AAA mail audit cover the template.

The notifications guide listed the notifier twice; it lists it once.
@dschmura
dschmura merged commit 4521480 into main Oct 16, 2026
16 checks passed
@dschmura
dschmura deleted the password-lock-emails-holder branch October 16, 2026 18:30
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.

1 participant