feat/login-alerts #86

Merged
nrupard merged 3 commits from feat/login-alerts into main 2026-05-13 20:01:32 +02:00
Owner
No description provided.
Adds a "login alerts" notification: the first time an account is signed in
from a given (User-Agent, IP) pair, the server emails the user-on-file
address with the device label, IP, and time, plus a deep-link to the
settings sessions list so a stranger sign-in can be revoked. Repeats from
the same device stay silent. A per-user opt-out toggle ships alongside the
existing digest preference and the dispatch is fire-and-forget so SMTP
latency or failure can't change the login response. Registration pre-seeds
the device so first-login from the same browser does not trigger an alert.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Each early-return path inside dispatch_login_alert is a possible "why didn't I get an email?" question. The dispatch runs in a spawned task off the response path, so a silent return is the only signal an operator gets. Log each suppression branch (SMTP unavailable, user opted out, no email on account, user record gone) at info or warn and log the successful send at info so an operator can diagnose without a debugger.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
chore(login-alerts): demote send and suppression logs to debug
Some checks failed
Check / clippy + fmt + tests (pull_request) Failing after 12s
b55d2a5154
The dispatch fires on every sign-in, so info-level chatter is too loud for normal operation. Drop the suppression branches and the success line to debug; keep the "user row vanished" branch at warn since it indicates a race the operator should know about.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
nrupard deleted branch feat/login-alerts 2026-05-13 20:01:32 +02:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
psa-systems/lets-chat!86
No description provided.