High Tech Sorcery

problems upgrading devise in an rails 2 to rails 3 migration

by on Apr.22, 2011, under Ruby On Rails

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

Leave a Reply

Looking for something?

Use the form below to search the site:

Still not finding what you're looking for? Drop a comment on a post or contact us so we can take care of it!

Blogroll

A few highly recommended websites...