lib/simple_auth/authenticated.rb in di-simple_auth-0.2.9 vs lib/simple_auth/authenticated.rb in di-simple_auth-0.3.0

- old
+ new

@@ -1,6 +1,6 @@ -require 'bcrypt' +require 'digest/sha1' module SimpleAuth module Authenticated # Hook for all Clearance::User modules. # # If you need to override parts of Clearance::User, @@ -76,11 +76,11 @@ protected def initialize_salt if new_record? - self.password_salt = BCrypt::Engine.generate_salt + self.password_salt = Digest::SHA1.hexdigest Time.now end end def generate_remember_token self.remember_token = encrypt("#{Time.now} -- #{Time.now}") @@ -93,10 +93,10 @@ def encrypt_password self.encrypted_password = encrypt(password) unless password.blank? end def encrypt(password) - BCrypt::Engine.hash_secret(password,password_salt) + Digest::SHA1.hexdigest "#{password}#{password_salt}" end end \ No newline at end of file