clearance
by
thoughtbot

Description: Rails authentication with email & password.

View thoughtbot/clearance on GitHub ↗

Summary Information

Updated 44 minutes ago
Added to GitGenius on July 30th, 2025
Created on September 24th, 2008
Open Issues/Pull Requests: 29 (+0)
Number of forks: 465
Total Stargazers: 3,732 (+0)
Total Subscribers: 64 (+0)
Detailed Description

Clearance is a popular, feature-rich authentication library for Ruby on Rails applications, developed and maintained by thoughtbot. It aims to provide a robust and secure foundation for user authentication without forcing developers to reinvent the wheel. Unlike minimalist authentication gems, Clearance offers a comprehensive set of functionalities "out of the box," including user registration, login, password recovery, email confirmation, and account management. It prioritizes developer experience by providing sensible defaults and clear documentation, allowing for quick integration and customization.

At its core, Clearance handles the complexities of securely storing user credentials (passwords are hashed using bcrypt by default), managing user sessions, and providing convenient helper methods for checking user authentication status. A key design principle is its focus on convention over configuration. It expects a standard Rails application structure and user model (typically named `User`) and minimizes the amount of configuration needed to get started. This makes it particularly well-suited for projects that adhere to Rails best practices. The gem provides controllers, views, and migrations to handle the core authentication flows, reducing boilerplate code significantly.

One of Clearance’s strengths is its flexibility. While it provides a complete authentication system, it’s designed to be easily extended and customized. Developers can override default views, customize email templates, and add additional attributes to the user model. It also supports various authentication strategies, including email confirmation (which is enabled by default) and password reset flows. Clearance integrates well with other Rails gems and libraries, allowing developers to build complex authentication systems tailored to their specific needs. For example, it can be combined with authorization gems like Pundit or CanCanCan to implement role-based access control.

The repository itself contains the core gem code, along with extensive documentation, tests, and example applications. The documentation is well-maintained and covers all aspects of the gem, from installation and configuration to customization and advanced usage. The tests ensure the gem's reliability and stability, and the example applications demonstrate how to integrate Clearance into a Rails project. The repository also includes a changelog that details all the changes made to the gem over time. Thoughtbot actively maintains Clearance, addressing bug fixes and security vulnerabilities promptly.

Beyond the core authentication features, Clearance also offers features like remember-me functionality (using cookies), account activation, and the ability to restrict access to specific controllers or actions based on authentication status. It also provides a `signed_in?` helper method that simplifies checking if a user is currently logged in. The gem’s design encourages secure coding practices, such as using strong password hashing algorithms and protecting against common web vulnerabilities like cross-site scripting (XSS) and cross-site request forgery (CSRF). Overall, Clearance is a powerful and well-maintained authentication library that simplifies the process of adding secure user authentication to Rails applications.

clearance
by
thoughtbotthoughtbot/clearance

Repository Details

Fetching additional details & charts...