BCrypt::Errors::InvalidHash in Devise::SessionsController#create during upgrade

2,342 views
Skip to first unread message

Jesse House

unread,
Oct 1, 2011, 11:17:22 AM10/1/11
to Devise
I am in the process of upgrading an application from
rails 2.3.12 with devise 1.0.11 to
rails 3.1.0 with devise 1.4.7

when I log as an existing user I receive the following exception:
BCrypt::Errors::InvalidHash in Devise::SessionsController#create

I believe this issue is caused because older versions of Devise did
not use BCrypt, is it possible to use the older style of encryption?
do I need to set the :encryptable option on my User model to a
specific encrypter?

would love to know the exact syntax for this

Thanks in advance,
- Jesse

Jesse House

unread,
Oct 7, 2011, 10:02:21 AM10/7/11
to Devise
bump...

going to look into this more in-depth later today, but wondering if
anyone has made a similar upgrade and been able to configure the
latest version of devise to use the encryption method used by the
older version?

Jesse House

unread,
Oct 7, 2011, 7:59:17 PM10/7/11
to Devise
posting this in-case anyone else comes across the same

the older version of devise was using :sha1
for devise 1.4.7 I made the following configuration updates
-> found this out with script/console => User.encryptor

in the User model add :encryptable to devise
class User
devise :registerable, :database_authenticatable, :encryptable, ...

in config/initializers/devise.rb add this line
config.encryptor = :sha1
Reply all
Reply to author
Forward
0 new messages