1
votes

Ok, so we have a legacy rails 2.3 system that uses authlogic for its users (implemented by the Spree commerce 0.11 platform)

We are migrating to a new bespoke rails 3.2 system using Devise. I would like to be able to migrate over existing users, including their passwords. Migrating the user details is easy and already achieved, passwords is causing an issue.

Originally I was hoping I could just pull across the existing encrypted password and carry on merrily. From first trials and research this doesn't seem to be the case.

Suggested solution seems to be to override the "valid_password?" devise method and manually check the Authlogic Hashed password first.

I don't really like this idea but if it's the best way i've got I'll do it. Problem is, because Authlogic was implemented by Spree not me I'm not sure what Hashing technique it's used nor how to repeat it. Other peoples examples do not produce the same hash result from correct passwords :( (ie here Converting existing password hash to Devise)

I know I've got a salt and an encrypted password for each user, and Authlogic seems to have no encryption configuration set by Spree. How can I find out how to replicate Authlogics check? Or is there another way of migrating the passwords?

Thanks

2

2 Answers

0
votes

Ended up switching out Devises back to Authlogic on the new Project to allow smooth migration. It was a bit of work but it seems the best action is to re use the same technique to reduce your headaches.

Of course when that was done importing was just sucking in the user table and configuring Authlogic the same.

danerourssaves answer would have likely worked but I didn't see it until well after we finished up. Also when I checked it was now a deadlink, but that is a good many months later I looked.