Overview
About Authem
Authem is an email-based authentication library for ruby web apps.
Compatibility
Authem requires Ruby 2.0.0 or newer
Documentation
Please see the Authem website for up-to-date documentation: http://authem.org
Upgrading to 2.0
- Specify the latest alpha release in your Gemfile:
gem 'authem', '2.0.0.alpha.3'
- Remove references to the old Authem::Config object.
- Create the new sessions table with
rails g authem:session
. - Replace
include Authem::ControllerSupport
withauthem_for :user
. - Rename
signed_in?
touser_signed_in? OR
alias_method :signed_in?, :user_signed_in?` in your controller. - Rename column
User#reset_password_token
toUser#password_reset_token
ORalias_attribute :password_reset_token, :reset_password_token
in yourUser
model. - Replace calls to
user#reset_password_token!
withuser#password_reset_token
. Tokens are now generated automatically and the bang method is deprecated. - Rename
sign_out
tosign_out_user
ORalias_method :sign_out, :sign_out_user
- If you were passing a remember flag as the second argument to
sign_in
, you need to provide an options hash instead. For example,sign_in(user, params[:remember])
would becomesign_in(user, remember: params[:remember])
. - Blank email addresses will now produce the proper "can't be blank" validation message". Update your tests accordingly.
- Email addresses are no longer automatically downcased when calling
find_by_email
on your model. You will need to downcase the value manually if you wish to retain this behavior.