Repository navigation
@checodo/better-auth-security-alerts@0.2.0
·
15 commits
to main
since this release
Minor Changes
-
7c1dafc: First release: tell users about security-relevant changes to their account.
sendAlertcallback for ten alert types, each on or off:new-device,password-changed,password-reset-requested,password-reset,email-changed(sent to the old address, with the new one masked),passkey-added,passkey-removed,two-factor-disabled,account-linked, andapi-key-created. Runs in the background withadvanced.backgroundTasks; errors are logged and never fail the request.- New-device detection with a
knownDevicetable: a hash of the browser family, OS family, and optionally the network, keyed with the auth secret. No alert on a user's first sign-in; devices count as new again after 90 days without a sign-in (newDevice.expiresIn);newDevice.isNewDeviceandnewDevice.getDeviceto decide yourself. secureAccount: a single-use "This wasn't me" link in the alerts. The link only redirects to your confirmation page; confirming (secureAccount) signs out every session, makes every device new again, removes the passkey, linked account, or API key the alert was about, optionally puts the old email address back (emailChange: "restore";"keep"by default), callsonSecured, and blocks the password and sends a reset link (password: "block", the default), or only sends the link ("send-reset"), or neither ("none").- A startup warning while
password-reset-requestedis on withoutadvanced.backgroundTasks(response times would tell which emails have an account). listDevicesandforgetDeviceendpoints for a "your devices" page.adminActionsto leave out or not mark alerts about changes an admin makes.- With the audit log plugin:
security.alert-sentandsecurity.account-securedevents.