problems upgrading devise in an rails 2 to rails 3 migration

I ran into some problems upgrading devise from 1.0.x to 1.3.x.

  • to use passwords besides bcrypt you have to made 2 changes:
    • in config/initializers/devise.rb
      • config.encryptor = :sha1 (for devise 1.0.x compatibility)
    • in User model (or whatever model calls devise)
      • call devise with both :database_authenticatable and :encryptable
    • you can tell you have issues with this if you see errors like BCrypt::Errors::InvalidHash or “invalid hash”
  • browser validation prevents sign in with something other than email

One Comment

Leave a Reply

Your email address will not be published. Required fields are marked *