PhxAuthPlus (phx_auth_plus v0.2.0)

View Source

PhxAuthPlus - Complete email + password authentication generator for Phoenix 1.8+.

Restores the full phx.gen.auth experience from Phoenix v1.7.21 that Phoenix 1.8 replaced with magic links only.

Quick Start

Add phx_auth_plus to your dependencies:

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

Then generate authentication:

mix phx_auth_plus.gen.auth Accounts User users

Features

  • Email + password authentication
  • 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
  • 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.