Module: Clearance::PasswordStrategies::Blowfish Deprecated

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

Overview

Deprecated.

Use BCrypt or clearance-deprecated_password_strategies gem

Constant Summary collapse

DEPRECATION_MESSAGE =
"[DEPRECATION] The Blowfish 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

Deprecated.

Use Clearance::PasswordStrategies::BCrypt or clearance-deprecated_password_strategies gem

Returns:

  • (Boolean)


16
17
18
19
# File 'lib/clearance/password_strategies/blowfish.rb', line 16

def authenticated?(password)
  warn "#{Kernel.caller.first}: #{DEPRECATION_MESSAGE}"
  encrypted_password == encrypt(password)
end

#password=(new_password) ⇒ Object

Deprecated.

Use Clearance::PasswordStrategies::BCrypt or clearance-deprecated_password_strategies gem



23
24
25
26
27
28
29
30
31
# File 'lib/clearance/password_strategies/blowfish.rb', line 23

def password=(new_password)
  warn "#{Kernel.caller.first}: #{DEPRECATION_MESSAGE}"
  @password = new_password
  initialize_salt_if_necessary

  if new_password.present?
    self.encrypted_password = encrypt(new_password)
  end
end