PhoenixKit.Users.Auth.KnownDevice (phoenix_kit v1.7.202)

Copy Markdown View Source

A device (IP + hashed user-agent) a user has previously logged in from.

Backs the new-login security alert: a login whose (ip_address, user_agent_hash) pair has no matching row for the user is a "new device" and — when new_login_alert_enabled is on — triggers user.new_login_detected in the activity log plus an email via PhoenixKit.Users.Auth.UserNotifier.deliver_new_login_alert/2.

The user agent is stored pre-hashed (SHA-256 hex, via PhoenixKit.Utils.SessionFingerprint.hash_user_agent/1) — the raw UA string is never persisted.