Add sign-up, sign-in, and password-reset flows to a new Rails app in minutes using the built-in generator.
Protect controller actions so only signed-in users can access them using a single before-action filter.
Customize authentication views, flash messages, and email subjects without forking the gem.
Add routing constraints so different parts of your app are only reachable by signed-in or signed-out users.
| thoughtbot/clearance | pluginaweek/state_machine | feedbin/feedbin | |
|---|---|---|---|
| Stars | 3,733 | 3,723 | 3,745 |
| Language | Ruby | Ruby | Ruby |
| Setup difficulty | easy | easy | hard |
| Complexity | 2/5 | 2/5 | 4/5 |
| Audience | developer | developer | developer |
Figures from each repo's GitHub metadata at analysis time.
Requires Rails 7.2+ and Ruby 3.3.11+, older versions are not supported.
Clearance is a Ruby gem that adds email-and-password authentication to Ruby on Rails applications. It is built by thoughtbot and designed to be small, well-tested, and straightforward to install. The gem supports Rails 7.2 and above, and Ruby 3.3.11 and above. To get started, you add the gem to your project, run the bundler, and then run a generator command. The generator does several things: it mixes authentication behavior into your User model, sets up your ApplicationController to know about sessions, creates a configuration initializer file, and generates a database migration that either creates a users table or adds the needed columns to one you already have. Once installed, you can protect any controller action by adding a before-action filter that checks whether the user is signed in. Clearance also provides routing constraints so you can decide which parts of your site signed-in users, signed-out users, or admins can reach, all from the routes file. In views and controllers you get three helper methods: one to get the current user, one to check whether someone is signed in, and one to check whether they are signed out. Password resets are built in. When a user requests a reset, Clearance sends them an email. You configure the sender address in the initializer file. The gem also supports multiple domains and can expose its session data to Rack middleware, so other parts of the application stack can interact with the authentication state. Most parts of Clearance can be replaced or adjusted. Routes can be disabled so you define your own URL design. Controllers can be subclassed to change specific behaviors. Views can be copied into your app for editing, and layouts per controller can be set in your application config. Flash messages and email subject lines live in translation files and can be overridden like any other string in a Rails project.
A Ruby gem by thoughtbot that adds email and password authentication to Ruby on Rails apps with a simple generator, built-in password resets, and customizable controllers and views.
Mainly Ruby. The stack also includes Ruby, Rails, Rack.
Open source under MIT license, use freely in any project including commercial applications.
Setup difficulty is rated easy, with roughly 30min to a first successful run.
Mainly developer.
This repo across BitVibe Labs
Verify against the repo before relying on details.