Module: Clearance::PasswordStrategies::BCryptMigrationFromSHA1

Defined in:
lib/clearance/password_strategies/bcrypt_migration_from_sha1.rb

Defined Under Namespace

Classes: BCryptUser, SHA1User

Constant Summary collapse

DEPRECATION_MESSAGE =
"[DEPRECATION] The BCryptMigrationFromSha1 " \
"password strategy has been deprecated and will be removed from " \
"Clearance 2.0. BCrypt is the only officially supported strategy, " \
"though you are free to provide your own. To continue using this " \
"strategy, add clearance-deprecated_password_strategies to your " \
"Gemfile."

Instance Method Summary collapse

Instance Method Details

#authenticated?(password) ⇒ Boolean

Returns:

  • (Boolean)


31
32
33
34
# File 'lib/clearance/password_strategies/bcrypt_migration_from_sha1.rb', line 31

def authenticated?(password)
  warn "#{Kernel.caller.first}: #{DEPRECATION_MESSAGE}"
  authenticated_with_sha1?(password) || authenticated_with_bcrypt?(password)
end

#password=(new_password) ⇒ Object



36
37
38
39
40
# File 'lib/clearance/password_strategies/bcrypt_migration_from_sha1.rb', line 36

def password=(new_password)
  warn "#{Kernel.caller.first}: #{DEPRECATION_MESSAGE}"
  @password = new_password
  BCryptUser.new(self).password = new_password
end