PhxAuthPlus (phx_auth_plus v0.3.3)

View Source

PhxAuthPlus - Complete authentication generator for Phoenix 1.8+.

Aligned with the Phoenix 1.8.9 phx.gen.auth templates. Provides email + password login, magic link login, registration, password reset, account confirmation, settings, and scope-based auth.

Quick Start

Add phx_auth_plus to your dependencies:

def deps do
  [
    {:phx_auth_plus, "~> 0.2", only: [:dev, :test]}
  ]
end

Then generate authentication:

mix phx_auth_plus.gen.auth Accounts User users

Features

  • Email + password authentication
  • Magic link login (passwordless)
  • LiveView and Controller support (--live / --no-live)
  • Multiple hashing libraries (bcrypt, pbkdf2, argon2)
  • Account confirmation by email
  • Password reset flow
  • Settings page (change email, change password)
  • "Remember me" with secure cookies
  • Session tracking and invalidation
  • Scope-based auth (current_scope)
  • Dynamic layout menu (login/register, email/settings/logout)
  • Built with Igniter for smart code generation

Options

mix phx_auth_plus.gen.auth Accounts User users \
  --hashing-lib pbkdf2 \
  --no-live \
  --binary-id

See mix help phx_auth_plus.gen.auth for all options.

Summary

Functions

Returns the default hashing library for the current OS.

Returns the supported hashing libraries.

Functions

default_hashing_lib()

Returns the default hashing library for the current OS.

Returns :bcrypt on Unix systems, :pbkdf2 on Windows.

supported_hashing_libs()

Returns the supported hashing libraries.