Hi !
I'm currently working on a Rails app which stores plain clear passwords (...). So I'm migrating to Authlogic authentication with a 'standard' SHA512 encryption.
I did that which works fine :
#file /models/user.rb
class User < ActiveRecord::Base
acts_as_authentic { |c|
c.transition_from_crypto_providers = [MyOwnNoCrypto, Authlogic::CryptoProviders::Sha512]
}
end
#file /lib/my_own_no_crypto.rb
class MyOwnNoCrypto
def self.encrypt(*tokens)
return tokens[0] # or tokens.join I guess
end
def self.matches?(crypted_password, *tokens)
return crypted_password == tokens.join
end
end
It's nice -- and works just fine -- but I wonder if there is a sexier way to do that, perhaps with an Authlogic core option ?
Thanks !