Magic Auth is an authentication library for Phoenix that provides effortless configuration and flexibility for your project.
- Ship Faster 🚀: No time wasted configuring password resets and recovery flows - just implement and ship your product.
- Passwordless Authentication 📨: Secure login process through one-time passwords sent via email. One-time passwords are better than magic links because users can receive the code on one device (e.g., phone email) and enter it on another (e.g., desktop browser).
- Enhanced Security 🔒: Protect your application from brute force attacks with built-in rate limiting and account lockout mechanisms.
- Customizable Interface 🎨: Use the beautiful default UI components out of the box, or customize them fully to match your design perfectly.
- Effortless Configuration and Comprehensive Documentation 📚: Quick and simple integration with your Phoenix project, with detailed guides and references to assist you through every step of the integration process.
- Schema Agnostic 👤: Implement authentication without requiring a user schema - ideal for everything from MVPs to complex applications.
You can find the full documentation for Magic Auth on HexDocs.
We welcome contributions! Here's how you can help improve Magic Auth:
Clone the repository
git clone https://github.com/your-username/magic_auth.git
cd magic_auth
Install dependencies
mix deps.get
Setup the test database
mix magic_auth.setup_test_db
Execute the test suite with:
mix test
Alternatively, you can use mix test.watch
for automatic test execution on file changes:
mix test.watch
Generate documentation locally:
mix docs
Compile the project:
mix compile
Before submitting a pull request, please:
- Ensure all tests pass
- Add tests for new functionality
- Update documentation as needed
- Follow the existing code style
Documentation can be generated with ExDoc and published on HexDocs. Once published, the docs can be found at https://hexdocs.pm/magic_auth.
If you find Magic Auth helpful, show your support by:
- Starring ⭐ the project on GitHub
- Following me on X (formerly Twitter): @gushonorato
Much of the code in this library is based on the mix phx.gen.auth
generator. Special thanks to all the contributors of mix phx.gen.auth
for their hard work and dedication in creating such a valuable tool for the Phoenix community. Your efforts have significantly inspired and influenced the development of Magic Auth.
Copyright (c) 2025, Gustavo Honorato.
Magic Auth source code is licensed under the MIT License.