# `PhoenixKit.Migrations.Postgres.V143`
[🔗](https://github.com/BeamLabEU/phoenix_kit/blob/v2.13.11/lib/phoenix_kit/migrations/postgres/v143.ex#L1)

V143: Known-device history for new-login security alerts.

`phoenix_kit_user_known_devices` remembers the (IP, hashed user-agent)
pairs a user has previously signed in from. `PhoenixKitWeb.Users.Auth
.log_in_user/3` checks this table on every login; an unrecognized pair
is a "new device" and — when the `new_login_alert_enabled` setting is
on — logs a `user.new_login_detected` activity entry and sends an email
via `PhoenixKit.Users.Auth.UserNotifier.deliver_new_login_alert/2`.

The user agent is stored pre-hashed (SHA-256 hex, matching
`PhoenixKit.Utils.SessionFingerprint.hash_user_agent/1`) — the raw UA
string is never persisted, only enough to recognize a repeat visit from
the same browser/OS combination.

# `down`

# `up`

---

*Consult [api-reference.md](api-reference.md) for complete listing*
