Skip to content

PhoenixKit 1.6.3: Rate limits, password rules and session fingerprints

PhoenixKit 1.6.3 hardens sign-in. Log-in, magic link, password reset and registration are now rate-limited, passwords can be required to contain certain characters, and each session remembers the IP address and browser it started from.

The default limits are 5 log-in attempts a minute, 3 magic links or password resets per 5 minutes, and 3 registrations an hour per email plus 10 per IP. They are set under config :phoenix_kit, PhoenixKit.Users.RateLimiter. Password rules go in config :phoenix_kit, :password_requirements: length, uppercase, lowercase, digit and special character, with only the 8 to 72 character length checked by default. A session used from another IP or browser is logged as a warning, or ended with session_fingerprint_strict: true. When an admin resets a user’s password, an audit log records who did it, from which IP and browser. Storage dimensions get Maintain Aspect Ratio, and blog posts can embed YouTube videos.

Upgrading

Run mix phoenix_kit.update: it adds the Hammer configuration and applies migrations V21 to V25. V24 puts a unique index on file checksums, so it fails if duplicate files are already stored. Auth.get_user_by_email_and_password/3 now returns {:ok, user} or {:error, reason}, so code that called it needs updating.

Full release notes: PhoenixKit 1.6.3

1.6.3 · 12 November 2025

Added

  • Configurable Password Requirements - Comprehensive password strength validation system with customizable requirements
    • Optional uppercase character requirement
    • Optional lowercase character requirement
    • Optional digit requirement
    • Optional special character requirement (!?@#$%^&*_)
    • Configurable minimum and maximum password length
    • Application-wide configuration via :password_requirements config key
    • Default behavior maintains backward compatibility (length validation only)

Changed

  • Password Validation Logic - Refactored validate_password/2 to use configurable requirements instead of hardcoded validations
  • User Schema Documentation - Enhanced documentation with detailed password requirements configuration examples

1.6.2 - Unreleased

Added

  • Audit Logging System - Comprehensive audit trail for administrative actions with detailed context tracking
  • Migration V22 Enhancement - Added audit log entries table with optimized indexes
    • Added phoenix_kit_audit_logs table for tracking administrative actions
    • Records admin user, target user, action type, IP address, and user agent
    • JSONB metadata field for flexible additional context
    • Optimized indexes for querying by user, action, and timestamp
    • Composite indexes for common query patterns
  • Admin Password Reset Logging - Automatic logging of password resets with full audit trail
    • WHO: Admin user ID and email
    • WHAT: Password reset action
    • WHEN: Timestamp with microsecond precision
    • WHERE: IP address of the admin
    • HOW: User agent string

Changed

  • Admin Password Update - Enhanced admin_update_user_password/3 to accept optional context parameter
    • Backward compatible - context parameter is optional
    • Non-failing design - logging errors don’t prevent password updates
    • Records complete audit trail when context is provided
  • User Form - Updated to pass admin user and IP context when updating user passwords
    • New build_audit_context/1 helper extracts context from LiveView socket
    • Automatically captures admin user, IP address, and user agent
    • Seamless integration with existing password update workflow

PhoenixKit 1.6.3. Install or update: {:phoenix_kit, "~> 1.6"}, then mix deps.get && mix phoenix_kit.update. Full history: CHANGELOG.