whisper-money/tests/Feature/Auth
Víctor Falcón fcf2d3d1ad
feat(users): track last login and last active timestamps (#516)
## What

Adds two timestamp columns to `users`:

- **`last_logged_in_at`** — set by an `UpdateLastLoggedInAt` listener on
Laravel's `Login` event. Records each explicit authentication (login
form or remember-me re-auth). Does **not** update on plain session-based
requests.
- **`last_active_at`** — set by a `TrackLastActiveAt` middleware on
authenticated web requests. Records the last moment the user did
anything. Throttled to at most one write per 5 minutes to avoid a DB
write on every request.

## Why

`last_logged_in_at` answers "when did they last authenticate";
`last_active_at` answers "when were they last using the app" (any
screen/activity), which a session-based login does not capture.

## Tests

- Login records `last_logged_in_at`
- Authenticated request records `last_active_at`
- Throttle window respected (no rewrite within 5 min) and refreshed once
it passes

Migrations not yet run on environments.
2026-06-10 11:01:30 +02:00
..
AuthenticationTest.php feat(users): track last login and last active timestamps (#516) 2026-06-10 11:01:30 +02:00
EmailVerificationTest.php fix: verify email via signed link without requiring login (#490) 2026-06-05 10:01:32 +02:00
PasswordConfirmationTest.php fix: route new PWA guests to signup (#313) 2026-04-21 10:53:05 +01:00
PasswordResetTest.php E2E Encryption 2025-11-07 14:21:25 +00:00
RegistrationTest.php fix(register): don't block signup on unrecognized browser timezone (#462) 2026-06-01 09:03:15 +02:00
TwoFactorChallengeTest.php E2E Encryption 2025-11-07 14:21:25 +00:00
VerificationNotificationTest.php fix: verify email via signed link without requiring login (#490) 2026-06-05 10:01:32 +02:00