mix phx_auth_plus.gen.auth (phx_auth_plus v0.3.2)
View SourceGenerates complete authentication for Phoenix 1.8+ applications.
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.
Usage
mix phx_auth_plus.gen.auth Accounts User users
mix phx_auth_plus.gen.auth Accounts User users --no-live
mix phx_auth_plus.gen.auth Accounts User users --hashing-lib pbkdf2
mix phx_auth_plus.gen.auth Accounts User users --binary-id
mix phx_auth_plus.gen.auth Accounts User users --web AuthOptions
--hashing-lib- bcrypt (default Unix), pbkdf2 (default Windows), argon2--live- Generate LiveView auth (default)--no-live- Generate controller-based auth only--binary-id- Use binary UUID keys--web- Web module to use (default: MyAppWeb)--context-app- Context app for umbrella projects--table- Custom table name (default: plural arg)
Generated features
- Email + password registration and login
- Magic link login (passwordless)
- "Remember me" with secure cookies
- Password reset (forgot password flow)
- Account confirmation by email
- Settings page (change password, change email)
- Session tracking and invalidation
- UserNotifier for email delivery
- Scope-based auth (current_scope)
- Auth layout (centered, no navbar) for login/register pages
After running:
mix ecto.migrate
mix phx.server