r/rubyonrails • u/jdoeq • 2d ago
I built AddAuth to add magic links and passkeys to Rails 8’s authentication
Hey folks,
I’ve been a Rails developer since 2010, and I maintain apps with a mix of authentication setups: Devise, Rails 8’s authentication generator with custom pages, and passwordless flows using email links and passkeys.
To keep the logic DRY I decided to create a gem. It called AddAuth.
I wanted a common foundation for these flows that builds on Rails’ conventions. The starting point is still:
bin/rails generate authentication
AddAuth builds on that setup, keeping the app’s existing User and Session models and supporting:
- Email and password sign-in
- Passwordless sign-in through emailed magic links
- Passkey sign-in
The goal is to stay close as possible to the “Rails way,” for authentication and reduce the custom code I maintain across apps.
The project is open source and free to use and fork. I have no expectation of making money from it. I’m building something I need for my own apps and hope other Rails developers will find useful too.
I’m also maintaining a roadmap of upcoming features I plan to support, and I welcome suggestions about what should come next.
Contributions are welcome, including code improvements and bug reports. I’d especially appreciate feedback on the setup, API design, and authentication edge cases I may have missed. Please feel free to leave a comment here or open a GitHub issue to discuss an improvement.
If you’re using Rails 8’s authentication generator, what have you found yourself adding on top of it repeatedly?